From bcc6821b25aee9380add5d0478689b5eb2ef677e Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 3 Mar 2006 01:39:11 +0100 Subject: [PATCH 01/24] fix for bug #16396: Events: Distant-future dates become past dates WL#1034 (Internal CRON) timestamps does not support > y2038 mysql-test/r/events_bugs.result: update results mysql-test/t/events_bugs.test: add tests sql/event_timed.cc: fix for bug #16396: Events: Distant-future dates become past dates. --- mysql-test/r/events_bugs.result | 6 +++++ mysql-test/t/events_bugs.test | 13 +++++++++++ sql/event_timed.cc | 41 ++++++++++++++++++++++++++------- 3 files changed, 52 insertions(+), 8 deletions(-) diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index 0b554f97b9a..c59adcd7447 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -1,5 +1,11 @@ create database if not exists events_test; use events_test; +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; +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 set global event_scheduler=0; "Wait a bit to settle down" delete from mysql.event; diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index 2d4374dcb41..cf19703333d 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -1,5 +1,18 @@ create database if not exists events_test; use events_test; +# +# Start - 16396: Events: Distant-future dates become past dates +# +--error 1503 +create event e_55 on schedule at 99990101000000 do drop table t; +--error 1503 +create event e_55 on schedule every 10 hour starts 99990101000000 do drop table t; +--error 1521 +create event e_55 on schedule every 10 minute ends 99990101000000 do drop table t; +# +# End - 16396: Events: Distant-future dates become past dates +# + # # Start - 16407: Events: Changes in sql_mode won't be taken into account # diff --git a/sql/event_timed.cc b/sql/event_timed.cc index a8620197668..bd5f23f9808 100644 --- a/sql/event_timed.cc +++ b/sql/event_timed.cc @@ -150,6 +150,7 @@ Event_timed::init_execute_at(THD *thd, Item *expr) { my_bool not_used; TIME ltime; + my_time_t t; TIME time_tmp; DBUG_ENTER("Event_timed::init_execute_at"); @@ -173,12 +174,18 @@ Event_timed::init_execute_at(THD *thd, Item *expr) TIME_to_ulonglong_datetime(&time_tmp)) DBUG_RETURN(EVEX_BAD_PARAMS); - /* 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, TIME_to_timestamp(thd,<ime, ¬_used)); + my_tz_UTC->gmt_sec_to_TIME(<ime,t=TIME_to_timestamp(thd,<ime,¬_used)); + if (!t) + { + DBUG_PRINT("error", ("Execute AT after year 2037")); + DBUG_RETURN(ER_WRONG_VALUE); + } execute_at_null= FALSE; execute_at= ltime; @@ -301,6 +308,7 @@ Event_timed::init_interval(THD *thd, Item *expr, interval_type new_interval) RETURNS 0 OK EVEX_PARSE_ERROR fix_fields failed + EVEX_BAD_PARAMS starts before now */ int @@ -308,6 +316,7 @@ Event_timed::init_starts(THD *thd, Item *new_starts) { my_bool not_used; TIME ltime, time_tmp; + my_time_t t; DBUG_ENTER("Event_timed::init_starts"); @@ -328,10 +337,17 @@ Event_timed::init_starts(THD *thd, Item *new_starts) DBUG_RETURN(EVEX_BAD_PARAMS); /* - This may result in a 1970-01-01 date if ltime is > 2037-xx-xx - CONVERT_TZ has similar problem + 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, TIME_to_timestamp(thd, <ime, ¬_used)); + my_tz_UTC->gmt_sec_to_TIME(<ime,t=TIME_to_timestamp(thd, <ime, ¬_used)); + if (!t) + { + DBUG_PRINT("error", ("STARTS after year 2037")); + DBUG_RETURN(EVEX_BAD_PARAMS); + } starts= ltime; starts_null= FALSE; @@ -358,6 +374,7 @@ Event_timed::init_starts(THD *thd, Item *new_starts) RETURNS 0 OK EVEX_PARSE_ERROR fix_fields failed + ER_WRONG_VALUE starts distant date (after year 2037) EVEX_BAD_PARAMS ENDS before STARTS */ @@ -366,6 +383,7 @@ Event_timed::init_ends(THD *thd, Item *new_ends) { TIME ltime, ltime_now; my_bool not_used; + my_time_t t; DBUG_ENTER("Event_timed::init_ends"); @@ -377,11 +395,18 @@ Event_timed::init_ends(THD *thd, Item *new_ends) DBUG_RETURN(EVEX_BAD_PARAMS); /* - This may result in a 1970-01-01 date if ltime is > 2037-xx-xx ? - CONVERT_TZ has similar problem ? + 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()) */ DBUG_PRINT("info", ("get the UTC time")); - my_tz_UTC->gmt_sec_to_TIME(<ime, TIME_to_timestamp(thd, <ime, ¬_used)); + my_tz_UTC->gmt_sec_to_TIME(<ime,t=TIME_to_timestamp(thd, <ime, ¬_used)); + if (!t) + { + DBUG_PRINT("error", ("ENDS after year 2037")); + DBUG_RETURN(EVEX_BAD_PARAMS); + } /* Check whether ends is after starts */ DBUG_PRINT("info", ("ENDS after STARTS?")); From 8ba5a687ed1604b2e08e113b489200117f48d446 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 13 Mar 2006 21:11:15 +0300 Subject: [PATCH 02/24] Fixed bug#17366: Unchecked Item_int results in server crash When there is conjunction of conds, the substitute_for_best_equal_field() will call the eliminate_item_equal() function in loop to build final expression. But if eliminate_item_equal() finds that some cond will always evaluate to 0, then that cond will be substituted by Item_int with value == 0. In this case on the next iteration eliminate_item_equal() will get that Item_int and treat it as Item_cond. This is leads to memory corruption and server crash on cleanup phase. To the eliminate_item_equal() function was added DBUG_ASSERT for checking that all items treaten as Item_cond are really Item_cond. The substitute_for_best_equal_field() now checks that if eliminate_item_equal() returns Item_int and it's value is 0 then this value is returned as the result of whole conjunction. mysql-test/t/subselect.test: Added test for bug#17366: Unchecked Item_int results in server crash mysql-test/r/subselect.result: Added test for bug#17366: Unchecked Item_int results in server crash sql/sql_select.cc: Fixed bug#17366: Unchecked Item_int results in server crash To the eliminate_item_equal() function was added DBUG_ASSERT for checking that all items treaten as Item_cond are really Item_cond. The substitute_for_best_equal_field() now checks that if eliminate_item_equal() returns something other than Item_cond and if it is then this value is returned as the result of whole conjunction. --- mysql-test/r/subselect.result | 7 +++++++ mysql-test/t/subselect.test | 7 +++++++ sql/sql_select.cc | 8 ++++++++ 3 files changed, 22 insertions(+) diff --git a/mysql-test/r/subselect.result b/mysql-test/r/subselect.result index 33b12c05f98..52b6be063b8 100644 --- a/mysql-test/r/subselect.result +++ b/mysql-test/r/subselect.result @@ -3157,3 +3157,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 9 Using where 2 DEPENDENT SUBQUERY t1 index NULL a 8 NULL 9 Using filesort DROP TABLE t1; +create table t1( f1 int,f2 int); +insert into t1 values (1,1),(2,2); +select tt.t from (select 'crash1' as t, f2 from t1) as tt left join t1 on tt.t = 'crash2' and tt.f2 = t1.f2 where tt.t = 'crash1'; +t +crash1 +crash1 +drop table t1; diff --git a/mysql-test/t/subselect.test b/mysql-test/t/subselect.test index 9e09b215951..0ab8c2892e4 100644 --- a/mysql-test/t/subselect.test +++ b/mysql-test/t/subselect.test @@ -2073,3 +2073,10 @@ SELECT * FROM t1 WHERE (a,b) = ANY (SELECT a, max(b) FROM t1 GROUP BY a); DROP TABLE t1; +# +# Bug#17366: Unchecked Item_int results in server crash +# +create table t1( f1 int,f2 int); +insert into t1 values (1,1),(2,2); +select tt.t from (select 'crash1' as t, f2 from t1) as tt left join t1 on tt.t = 'crash2' and tt.f2 = t1.f2 where tt.t = 'crash1'; +drop table t1; diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 768ae7bf71f..24811b55b0b 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7066,7 +7066,10 @@ static Item *eliminate_item_equal(COND *cond, COND_EQUAL *upper_levels, if (!cond) cond= new Item_cond_and(eq_list); else + { + DBUG_ASSERT(cond->type() == Item::COND_ITEM); ((Item_cond *) cond)->add_at_head(&eq_list); + } cond->quick_fix_field(); cond->update_used_tables(); @@ -7151,6 +7154,11 @@ static COND* substitute_for_best_equal_field(COND *cond, while ((item_equal= it++)) { cond= eliminate_item_equal(cond, cond_equal->upper_levels, item_equal); + // This occurs when eliminate_item_equal() founds that cond is + // always false and substitues it with Item_int 0. + // Due to this, value of item_equal will be 0, so just return it. + if (cond->type() != Item::ITEM_COND) + break; } } } From bff2fc2210aa97d6ec5c94c787904d24afcc7aa6 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Mar 2006 14:51:48 +0100 Subject: [PATCH 03/24] Bug#18195 MySQL on Windows not built with YaSSL correctly - Add HAVE_OPENSSL and HAVE_YASSL to config-win.h include/config-win.h: Define HAVE_OPENSSL and HAVE_YASSL to make the server and client enable SSL support --- include/config-win.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/config-win.h b/include/config-win.h index cccd660efec..6dbfae1716e 100644 --- a/include/config-win.h +++ b/include/config-win.h @@ -413,8 +413,8 @@ inline double ulonglong2double(ulonglong value) #define HAVE_SPATIAL 1 #define HAVE_RTREE_KEYS 1 -/* #undef HAVE_OPENSSL */ -/* #undef HAVE_YASSL */ +#define HAVE_OPENSSL 1 +#define HAVE_YASSL 1 /* Define charsets you want */ /* #undef HAVE_CHARSET_armscii8 */ From 5da3a478a10e67041687c1dc3a0b770fa5b41da0 Mon Sep 17 00:00:00 2001 From: unknown Date: Tue, 14 Mar 2006 18:49:37 +0300 Subject: [PATCH 04/24] sql_select.cc: Afterfix for bug#17366: Unchecked Item_int results in server crash sql/sql_select.cc: Afterfix for bug#17366: Unchecked Item_int results in server crash --- sql/sql_select.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 24811b55b0b..6e530b58d74 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -7157,7 +7157,7 @@ static COND* substitute_for_best_equal_field(COND *cond, // This occurs when eliminate_item_equal() founds that cond is // always false and substitues it with Item_int 0. // Due to this, value of item_equal will be 0, so just return it. - if (cond->type() != Item::ITEM_COND) + if (cond->type() != Item::COND_ITEM) break; } } From 1dc87feb20fbfd7cf3fe974f7e39fd6892ebcf85 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Mar 2006 11:57:37 +0400 Subject: [PATCH 05/24] xml.result, xml.test: Adding test. item_xmlfunc.cc: Bug #18171 XML: ExtractValue: the XPath position() function crashes the server! Disallowing use of position() and last() without context. sql/item_xmlfunc.cc: Bug #18171 XML: ExtractValue: the XPath position() function crashes the server! Disallowing use of position() and last() without context. mysql-test/t/xml.test: Adding test. mysql-test/r/xml.result: Adding test. --- mysql-test/r/xml.result | 4 ++++ mysql-test/t/xml.test | 9 +++++++++ sql/item_xmlfunc.cc | 6 ++++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/mysql-test/r/xml.result b/mysql-test/r/xml.result index bb7a158593c..d213ef98885 100644 --- a/mysql-test/r/xml.result +++ b/mysql-test/r/xml.result @@ -609,3 +609,7 @@ extractvalue('Jack','/a[contains(../a,"j")]' collate latin1_bin) select extractvalue('Jack' collate latin1_bin,'/a[contains(../a,"j")]'); extractvalue('Jack' collate latin1_bin,'/a[contains(../a,"j")]') +select extractValue('1','position()'); +ERROR HY000: XPATH syntax error: '' +select extractValue('1','last()'); +ERROR HY000: XPATH syntax error: '' diff --git a/mysql-test/t/xml.test b/mysql-test/t/xml.test index 831867937e4..ae1c9cf3b6b 100644 --- a/mysql-test/t/xml.test +++ b/mysql-test/t/xml.test @@ -277,3 +277,12 @@ select extractvalue('Jack','/a[contains(../a,"J")]'); select extractvalue('Jack','/a[contains(../a,"j")]'); select extractvalue('Jack','/a[contains(../a,"j")]' collate latin1_bin); select extractvalue('Jack' collate latin1_bin,'/a[contains(../a,"j")]'); + +# +# Bug #18171 XML: ExtractValue: the XPath position() +# function crashes the server! +# +--error 1105 +select extractValue('1','position()'); +--error 1105 +select extractValue('1','last()'); diff --git a/sql/item_xmlfunc.cc b/sql/item_xmlfunc.cc index 7378be0ac4c..da39c1e4409 100644 --- a/sql/item_xmlfunc.cc +++ b/sql/item_xmlfunc.cc @@ -1141,13 +1141,15 @@ static Item *create_func_round(MY_XPATH *xpath, Item **args, uint nargs) static Item *create_func_last(MY_XPATH *xpath, Item **args, uint nargs) { - return new Item_func_xpath_count(xpath->context, xpath->pxml); + return xpath->context ? + new Item_func_xpath_count(xpath->context, xpath->pxml) : NULL; } static Item *create_func_position(MY_XPATH *xpath, Item **args, uint nargs) { - return new Item_func_xpath_position(xpath->context, xpath->pxml); + return xpath->context ? + new Item_func_xpath_position(xpath->context, xpath->pxml) : NULL; } From 03e84028d72d6b0bc0e072c0305e47b9b7fbd8b4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Mar 2006 02:16:16 -0600 Subject: [PATCH 06/24] sql: removed double entries for sql_yacc.* and added -p MYSQL define to call to bison win/cmakefiles/sql: removed double entries for sql_yacc.* and added -p MYSQL define to call to bison --- win/cmakefiles/sql | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/win/cmakefiles/sql b/win/cmakefiles/sql index 72a71cbf14f..2099ef94996 100644 --- a/win/cmakefiles/sql +++ b/win/cmakefiles/sql @@ -38,7 +38,7 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc discover. sql_lex.cc sql_list.cc sql_load.cc sql_manager.cc sql_map.cc sql_parse.cc sql_partition.cc sql_plugin.cc sql_prepare.cc sql_rename.cc sql_repl.cc sql_select.cc sql_show.cc sql_state.c sql_string.cc sql_table.cc sql_test.cc sql_trigger.cc sql_udf.cc sql_union.cc - sql_update.cc sql_view.cc sql_yacc.h sql_yacc.cc strfunc.cc table.cc thr_malloc.cc time.cc tztime.cc + sql_update.cc sql_view.cc strfunc.cc table.cc thr_malloc.cc time.cc tztime.cc uniques.cc unireg.cc item_xmlfunc.cc rpl_tblmap.cc sql_binlog.cc event_executor.cc event_timed.cc sql_tablespace.cc event.cc ../sql-common/my_user.c partition_info.cc ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc @@ -56,7 +56,7 @@ ADD_DEPENDENCIES(mysqld GenError) ADD_CUSTOM_COMMAND( SOURCE ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy OUTPUT ${PROJECT_SOURCE_DIR}/sql/sql_yacc.cc - COMMAND bison.exe ARGS --defines=sql_yacc.h --output=sql_yacc.cc sql_yacc.yy + COMMAND bison.exe ARGS -y -p MYSQL --defines=sql_yacc.h --output=sql_yacc.cc sql_yacc.yy DEPENDS ${PROJECT_SOURCE_DIR}/sql/sql_yacc.yy) ADD_CUSTOM_COMMAND( From afab172a1dbccbae60fa49c2e934221a23356b12 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Mar 2006 11:21:36 +0100 Subject: [PATCH 07/24] Bug#18250 (Truncate table replicate both as statement and as individual rows for SEs using injector): Table truncation ("DELETE FROM t1" and "TRUNCATE t1") was logged as a statement even when the storage engine deletes the rows individually using the injector. sql/sql_delete.cc: Don't log a truncate statement if the storage engine is using the injector. --- sql/sql_delete.cc | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/sql/sql_delete.cc b/sql/sql_delete.cc index 34947e35b17..f4186120766 100644 --- a/sql/sql_delete.cc +++ b/sql/sql_delete.cc @@ -82,8 +82,9 @@ bool mysql_delete(THD *thd, TABLE_LIST *table_list, COND *conds, table->file->info(HA_STATUS_VARIABLE | HA_STATUS_NO_LOCK); ha_rows const maybe_deleted= table->file->records; /* - If all rows shall be deleted, we always log this statement-based - (see [binlog], below), so we set this flag and test it below. + If all rows shall be deleted, we (almost) always log this + statement-based (see [binlog], below), so we set this flag and + test it below. */ ha_delete_all_rows= 1; if (!(error=table->file->delete_all_rows())) @@ -330,12 +331,13 @@ cleanup: thd->clear_error(); /* - [binlog]: If 'handler::delete_all_rows()' was called, we - replicate statement-based; otherwise, 'ha_delete_row()' was - used to delete specific rows which we might log row-based. + [binlog]: If 'handler::delete_all_rows()' was called and the + storage engine does not inject the rows itself, we replicate + statement-based; otherwise, 'ha_delete_row()' was used to + delete specific rows which we might log row-based. */ THD::enum_binlog_query_type const - query_type(ha_delete_all_rows ? + query_type(ha_delete_all_rows && !table->file->is_injective() ? THD::STMT_QUERY_TYPE : THD::ROW_QUERY_TYPE); int log_result= thd->binlog_query(query_type, From f70aa0275399cbbf47e7756a3ee67e12ddc8eda4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Mar 2006 05:20:27 -0600 Subject: [PATCH 08/24] README: new file --- win/README | 75 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 win/README diff --git a/win/README b/win/README new file mode 100644 index 00000000000..c8eed8e93fe --- /dev/null +++ b/win/README @@ -0,0 +1,75 @@ +Windows building readme +====================================== + +----------------IMPORTANT---------------------------- +This readme outlines the instructions for building +MySQL for Windows staring from version 5.1. +This readme does not apply to MySQL versions 5.0 +or ealier. +----------------------------------------------------- + +The Windows build system uses a tool named CMake to generate build files for +a variety of project systems. This tool is combined with a set of jscript +files to enable building of MySQL for Windows directly out of a bk clone. +The steps required are below. + +Step 1 +------ +Download and install CMake. It can be downloaded from http://www.cmake.org. +Once it is installed, modify your path to make sure you can execute +the cmake binary. + +Step 2 +------ +Download and install bison for Windows. It can be downloaded from +http://gnuwin32.sourceforge.net/packages/bison.htm. Please download using +the link named "Complete package, excluding sources". This includes an +installer that will install bison. After the installer finishes, modify +your path so that you can execute bison. + +Step 3 +------ +Clone your bk tree to any location you like. + +Step 4 +------ +From the root of your bk clone, execute the command: win\configure . +The options right now are WITH_INNODB and WITH_PARTITION. So the command line +would look like: + +win\configure WITH_INNODB WITH_PARTITION + +These are the only two flags supported right now. Others will come later. + +Step 5 +------ +From the root of your bk clone, execute one of the batch files to generate the type +of project files you desire. + +For Visual Studio 8, do win\build-vs8. +For Visual Studio 7.1, do win\build-vs71. + +We will support building with nmake in the near future. + +Step 6 +------ +From the root of your bk clone, start your build. + +For Visual Studio, simply execute mysql.sln. This will start the IDE and you can +click the build solution menu option. + +Current issues +-------------- +1. Dependencies are not handled correctly with the current scripts. What +this means is that a new error file may not be generated when the errmsg.txt +file changes. In this case, simply force the GenError target to build. This +should execute comp_err to generate the required files. + +2. Not all configurations are currently available. i.e. Classic, Pro, Max. +Currently, only debug and release are available. This will change in the near +future. + +3. The definitions set for features (partitioning, blackhole, etc) are not +changed based on the options given with configure. This will soon be fixed +as well. + From 28036f38ef28274c52c79aeea3897efa7e6e9d74 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Mar 2006 16:29:25 +0100 Subject: [PATCH 09/24] Bug#18208 SBR fails to replicate auto_increment values for Cluster - Replication of tables with autoincrement not supported when maste and or slave uses storage engine "ndb" mysql-test/t/disabled.def: Remove disabling of testscase mysql-test/t/rpl_ndb_multi_update2.test: Only run this test when row based replication is available --- mysql-test/t/disabled.def | 1 - mysql-test/t/rpl_ndb_multi_update2.test | 5 +++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 9bd7a42e8de..aa4b7ecaa17 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -38,4 +38,3 @@ rpl_ndb_sp007 : Bug #17290 rpl_sp : Bug#16456 rpl_until : Unstable test case, bug#15886 sp-goto : GOTO is currently is disabled - will be fixed in the future -rpl_ndb_multi_update2 : BUG#17738 In progress diff --git a/mysql-test/t/rpl_ndb_multi_update2.test b/mysql-test/t/rpl_ndb_multi_update2.test index d337ddfe88a..df4f0eec39d 100644 --- a/mysql-test/t/rpl_ndb_multi_update2.test +++ b/mysql-test/t/rpl_ndb_multi_update2.test @@ -3,5 +3,10 @@ # to reuse test code between engine runs # ############################################################ -- source include/have_ndb.inc + +# Run this only for row based replication, as replication of +# auto_increment values are not supported with NDB as storage engine +-- source include/have_binlog_format_row.inc + let $engine_type=NDB; --source extra/rpl_tests/rpl_multi_update2.test From 66f7f0869bd84bd9e0eb4686ba63e630e2a1c017 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Mar 2006 10:22:12 -0600 Subject: [PATCH 10/24] Moved cmake scripts into the proper directories sql/cmakelists.txt: Rename: sql/sql -> sql/cmakelists.txt zlib/cmakelists.txt: Rename: win/cmakefiles/zlib -> zlib/cmakelists.txt vio/cmakelists.txt: Rename: win/cmakefiles/vio -> vio/cmakelists.txt regex/cmakelists.txt: Rename: win/cmakefiles/regex -> regex/cmakelists.txt mysys/cmakelists.txt: Rename: win/cmakefiles/mysys -> mysys/cmakelists.txt cmakelists.txt: Rename: win/cmakefiles/base -> cmakelists.txt dbug/cmakelists.txt: Rename: win/cmakefiles/dbug -> dbug/cmakelists.txt strings/cmakelists.txt: Rename: win/cmakefiles/strings -> strings/cmakelists.txt libmysql/cmakelists.txt: Rename: win/cmakefiles/libmysql -> libmysql/cmakelists.txt client/cmakelists.txt: Rename: win/cmakefiles/client -> client/cmakelists.txt extra/cmakelists.txt: Rename: win/cmakefiles/extra -> extra/cmakelists.txt tests/cmakelists.txt: Rename: win/cmakefiles/tests -> tests/cmakelists.txt server-tools/instance-manager/cmakelists.txt: Rename: win/cmakefiles/im -> server-tools/instance-manager/cmakelists.txt storage/heap/cmakelists.txt: Rename: win/cmakefiles/heap -> storage/heap/cmakelists.txt storage/myisam/cmakelists.txt: Rename: win/cmakefiles/myisam -> storage/myisam/cmakelists.txt storage/myisammrg/cmakelists.txt: Rename: win/cmakefiles/myisammrg -> storage/myisammrg/cmakelists.txt storage/bdb/cmakelists.txt: Rename: win/cmakefiles/bdb -> storage/bdb/cmakelists.txt storage/innobase/cmakelists.txt: Rename: win/cmakefiles/innobase -> storage/innobase/cmakelists.txt extra/yassl/cmakelists.txt: Rename: win/cmakefiles/yassl -> extra/yassl/cmakelists.txt extra/yassl/taocrypt/cmakelists.txt: Rename: win/cmakefiles/taocrypt -> extra/yassl/taocrypt/cmakelists.txt BitKeeper/deleted/.del-deploy.bat~f6b42340: Delete: win/cmakefiles/deploy.bat --- .../client => client/cmakelists.txt | 0 win/cmakefiles/base => cmakelists.txt | 0 win/cmakefiles/dbug => dbug/cmakelists.txt | 0 win/cmakefiles/extra => extra/cmakelists.txt | 0 .../yassl => extra/yassl/cmakelists.txt | 0 .../yassl/taocrypt/cmakelists.txt | 0 .../libmysql => libmysql/cmakelists.txt | 0 win/cmakefiles/mysys => mysys/cmakelists.txt | 0 win/cmakefiles/regex => regex/cmakelists.txt | 0 .../instance-manager/cmakelists.txt | 0 win/cmakefiles/sql => sql/cmakelists.txt | 0 .../bdb => storage/bdb/cmakelists.txt | 0 .../heap => storage/heap/cmakelists.txt | 0 .../innobase/cmakelists.txt | 0 .../myisam => storage/myisam/cmakelists.txt | 0 .../myisammrg/cmakelists.txt | 0 .../strings => strings/cmakelists.txt | 0 win/cmakefiles/tests => tests/cmakelists.txt | 0 win/cmakefiles/vio => vio/cmakelists.txt | 0 win/cmakefiles/deploy.bat | 21 ------------------- win/cmakefiles/zlib => zlib/cmakelists.txt | 0 21 files changed, 21 deletions(-) rename win/cmakefiles/client => client/cmakelists.txt (100%) rename win/cmakefiles/base => cmakelists.txt (100%) rename win/cmakefiles/dbug => dbug/cmakelists.txt (100%) rename win/cmakefiles/extra => extra/cmakelists.txt (100%) rename win/cmakefiles/yassl => extra/yassl/cmakelists.txt (100%) rename win/cmakefiles/taocrypt => extra/yassl/taocrypt/cmakelists.txt (100%) rename win/cmakefiles/libmysql => libmysql/cmakelists.txt (100%) rename win/cmakefiles/mysys => mysys/cmakelists.txt (100%) rename win/cmakefiles/regex => regex/cmakelists.txt (100%) rename win/cmakefiles/im => server-tools/instance-manager/cmakelists.txt (100%) rename win/cmakefiles/sql => sql/cmakelists.txt (100%) rename win/cmakefiles/bdb => storage/bdb/cmakelists.txt (100%) rename win/cmakefiles/heap => storage/heap/cmakelists.txt (100%) rename win/cmakefiles/innobase => storage/innobase/cmakelists.txt (100%) rename win/cmakefiles/myisam => storage/myisam/cmakelists.txt (100%) rename win/cmakefiles/myisammrg => storage/myisammrg/cmakelists.txt (100%) rename win/cmakefiles/strings => strings/cmakelists.txt (100%) rename win/cmakefiles/tests => tests/cmakelists.txt (100%) rename win/cmakefiles/vio => vio/cmakelists.txt (100%) delete mode 100644 win/cmakefiles/deploy.bat rename win/cmakefiles/zlib => zlib/cmakelists.txt (100%) diff --git a/win/cmakefiles/client b/client/cmakelists.txt similarity index 100% rename from win/cmakefiles/client rename to client/cmakelists.txt diff --git a/win/cmakefiles/base b/cmakelists.txt similarity index 100% rename from win/cmakefiles/base rename to cmakelists.txt diff --git a/win/cmakefiles/dbug b/dbug/cmakelists.txt similarity index 100% rename from win/cmakefiles/dbug rename to dbug/cmakelists.txt diff --git a/win/cmakefiles/extra b/extra/cmakelists.txt similarity index 100% rename from win/cmakefiles/extra rename to extra/cmakelists.txt diff --git a/win/cmakefiles/yassl b/extra/yassl/cmakelists.txt similarity index 100% rename from win/cmakefiles/yassl rename to extra/yassl/cmakelists.txt diff --git a/win/cmakefiles/taocrypt b/extra/yassl/taocrypt/cmakelists.txt similarity index 100% rename from win/cmakefiles/taocrypt rename to extra/yassl/taocrypt/cmakelists.txt diff --git a/win/cmakefiles/libmysql b/libmysql/cmakelists.txt similarity index 100% rename from win/cmakefiles/libmysql rename to libmysql/cmakelists.txt diff --git a/win/cmakefiles/mysys b/mysys/cmakelists.txt similarity index 100% rename from win/cmakefiles/mysys rename to mysys/cmakelists.txt diff --git a/win/cmakefiles/regex b/regex/cmakelists.txt similarity index 100% rename from win/cmakefiles/regex rename to regex/cmakelists.txt diff --git a/win/cmakefiles/im b/server-tools/instance-manager/cmakelists.txt similarity index 100% rename from win/cmakefiles/im rename to server-tools/instance-manager/cmakelists.txt diff --git a/win/cmakefiles/sql b/sql/cmakelists.txt similarity index 100% rename from win/cmakefiles/sql rename to sql/cmakelists.txt diff --git a/win/cmakefiles/bdb b/storage/bdb/cmakelists.txt similarity index 100% rename from win/cmakefiles/bdb rename to storage/bdb/cmakelists.txt diff --git a/win/cmakefiles/heap b/storage/heap/cmakelists.txt similarity index 100% rename from win/cmakefiles/heap rename to storage/heap/cmakelists.txt diff --git a/win/cmakefiles/innobase b/storage/innobase/cmakelists.txt similarity index 100% rename from win/cmakefiles/innobase rename to storage/innobase/cmakelists.txt diff --git a/win/cmakefiles/myisam b/storage/myisam/cmakelists.txt similarity index 100% rename from win/cmakefiles/myisam rename to storage/myisam/cmakelists.txt diff --git a/win/cmakefiles/myisammrg b/storage/myisammrg/cmakelists.txt similarity index 100% rename from win/cmakefiles/myisammrg rename to storage/myisammrg/cmakelists.txt diff --git a/win/cmakefiles/strings b/strings/cmakelists.txt similarity index 100% rename from win/cmakefiles/strings rename to strings/cmakelists.txt diff --git a/win/cmakefiles/tests b/tests/cmakelists.txt similarity index 100% rename from win/cmakefiles/tests rename to tests/cmakelists.txt diff --git a/win/cmakefiles/vio b/vio/cmakelists.txt similarity index 100% rename from win/cmakefiles/vio rename to vio/cmakelists.txt diff --git a/win/cmakefiles/deploy.bat b/win/cmakefiles/deploy.bat deleted file mode 100644 index 44ecb2d55fb..00000000000 --- a/win/cmakefiles/deploy.bat +++ /dev/null @@ -1,21 +0,0 @@ -@echo off -copy base ..\..\cmakelists.txt -copy client ..\..\client\cmakelists.txt -copy dbug ..\..\dbug\cmakelists.txt -copy extra ..\..\extra\cmakelists.txt -copy mysys ..\..\mysys\cmakelists.txt -copy regex ..\..\regex\cmakelists.txt -copy sql ..\..\sql\cmakelists.txt -copy strings ..\..\strings\cmakelists.txt -copy vio ..\..\vio\cmakelists.txt -copy zlib ..\..\zlib\cmakelists.txt -copy yassl ..\..\extra\yassl\cmakelists.txt -copy taocrypt ..\..\extra\yassl\taocrypt\cmakelists.txt -copy bdb ..\..\storage\bdb\cmakelists.txt -copy heap ..\..\storage\heap\cmakelists.txt -copy innobase ..\..\storage\innobase\cmakelists.txt -copy myisam ..\..\storage\myisam\cmakelists.txt -copy myisammrg ..\..\storage\myisammrg\cmakelists.txt -copy im ..\..\server-tools\instance-manager\cmakelists.txt -copy libmysql ..\..\libmysql\cmakelists.txt -copy tests ..\..\tests\cmakelists.txt diff --git a/win/cmakefiles/zlib b/zlib/cmakelists.txt similarity index 100% rename from win/cmakefiles/zlib rename to zlib/cmakelists.txt From a477e78bdb80363d40d228712ed9a54ee4bb9843 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Mar 2006 10:33:16 -0600 Subject: [PATCH 11/24] Removed calls to deploy.bat from the build scripts since the cmake scripts are now out in the target directories. --- win/build-vs71.bat | 5 ----- win/build-vs8.bat | 5 ----- 2 files changed, 10 deletions(-) diff --git a/win/build-vs71.bat b/win/build-vs71.bat index db92d9c3b72..46f3bc32f6e 100644 --- a/win/build-vs71.bat +++ b/win/build-vs71.bat @@ -1,10 +1,5 @@ @echo off -REM - First we need to copy all the cmakelists to the proper folders -cd win\cmakefiles -call deploy.bat -cd ..\.. - del cmakecache.txt copy win\vs71cache.txt cmakecache.txt cmake -G "Visual Studio 7 .NET 2003" diff --git a/win/build-vs8.bat b/win/build-vs8.bat index 54789b16503..349c3e78628 100644 --- a/win/build-vs8.bat +++ b/win/build-vs8.bat @@ -1,10 +1,5 @@ @echo off -REM - First we need to copy all the cmakelists to the proper folders -cd win\cmakefiles -call deploy.bat -cd ..\.. - del cmakecache.txt copy win\vs8cache.txt cmakecache.txt cmake -G "Visual Studio 8 2005" From 271d20ba970deb14e847010dffbb7d3db73777a4 Mon Sep 17 00:00:00 2001 From: unknown Date: Wed, 15 Mar 2006 20:21:59 +0300 Subject: [PATCH 12/24] A fix and test case for Bug#16164 "Easter egg": SHOW AUTHORS caused 'Packets out of order' in stored functions: add the corresponding SQLCOM to sp_get_flags_for_command so that it'd return sp-related flags for it. Fix Bug#17403 "Events: packets out of order with show create event" in the same chaneset. mysql-test/r/events.result: Update the results (Bug#17403) mysql-test/r/sp-error.result: Test results fixed (Bug#16164) mysql-test/t/events.test: Add a test case for Bug#17403 "Events: packets out of order with show create event" mysql-test/t/sp-error.test: Add a test case for Bug#16164 "Easter egg" sql/sp_head.cc: Add SHOW AUTHORS to the list of commands that return a result set: such commands are not allowed in stored functions and triggers. Add SHOW CREATE EVENT for the same reason. --- mysql-test/r/events.result | 6 ++++++ mysql-test/r/sp-error.result | 7 +++++++ mysql-test/t/events.test | 10 ++++++++++ mysql-test/t/sp-error.test | 18 ++++++++++++++++++ sql/sp_head.cc | 2 ++ 5 files changed, 43 insertions(+) diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index ecaf1ec252e..ced21440686 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -465,4 +465,10 @@ select event_schema, event_name, definer, event_body from information_schema.eve event_schema event_name definer event_body events_test white_space root@localhost select 3 drop event white_space; +create event e1 on schedule every 1 year do set @a = 5; +create table t1 (s1 int); +create trigger t1_ai after insert on t1 for each row show create event e1; +ERROR 0A000: Not allowed to return a result set from a trigger +drop table t1; +drop event e1; drop database events_test; diff --git a/mysql-test/r/sp-error.result b/mysql-test/r/sp-error.result index 5ab8779782a..40fe0b09814 100644 --- a/mysql-test/r/sp-error.result +++ b/mysql-test/r/sp-error.result @@ -1166,3 +1166,10 @@ drop procedure bug15091; drop function if exists bug16896; create aggregate function bug16896() returns int return 1; ERROR 42000: AGGREGATE is not supported for stored functions +drop function if exists bug16164; +create function bug16164() returns int +begin +show authors; +return 42; +end| +ERROR 0A000: Not allowed to return a result set from a function diff --git a/mysql-test/t/events.test b/mysql-test/t/events.test index a261b3c0c11..d9d8d75ff8c 100644 --- a/mysql-test/t/events.test +++ b/mysql-test/t/events.test @@ -427,6 +427,16 @@ drop event white_space; # END: BUG #17453: Creating Event crash the server # +# +# Bug#17403 "Events: packets out of order with show create event" +# +create event e1 on schedule every 1 year do set @a = 5; +create table t1 (s1 int); +--error ER_SP_NO_RETSET +create trigger t1_ai after insert on t1 for each row show create event e1; +drop table t1; +drop event e1; + ##set global event_scheduler=1; ##select get_lock("test_lock3", 20); ##create event закачка on schedule every 10 hour do select get_lock("test_lock3", 20); diff --git a/mysql-test/t/sp-error.test b/mysql-test/t/sp-error.test index 4b307de2ad0..da40cdf643a 100644 --- a/mysql-test/t/sp-error.test +++ b/mysql-test/t/sp-error.test @@ -1691,6 +1691,24 @@ drop function if exists bug16896; --error ER_SP_NO_AGGREGATE create aggregate function bug16896() returns int return 1; +# +# End of 5.0 tests +# + +# +# Bug#16164 "Easter egg": check that SHOW AUTHORS is disabled in +# stored functions/triggers +# +--disable_warnings +drop function if exists bug16164; +--enable_warnings +delimiter |; +--error ER_SP_NO_RETSET +create function bug16164() returns int +begin + show authors; + return 42; +end| # # BUG#NNNN: New bug synopsis diff --git a/sql/sp_head.cc b/sql/sp_head.cc index d97dcc390ca..ea2f67b3ba5 100644 --- a/sql/sp_head.cc +++ b/sql/sp_head.cc @@ -176,6 +176,7 @@ sp_get_flags_for_command(LEX *lex) case SQLCOM_SHOW_CREATE_DB: case SQLCOM_SHOW_CREATE_FUNC: case SQLCOM_SHOW_CREATE_PROC: + case SQLCOM_SHOW_CREATE_EVENT: case SQLCOM_SHOW_DATABASES: case SQLCOM_SHOW_ERRORS: case SQLCOM_SHOW_FIELDS: @@ -200,6 +201,7 @@ sp_get_flags_for_command(LEX *lex) case SQLCOM_SHOW_WARNS: case SQLCOM_SHOW_PROC_CODE: case SQLCOM_SHOW_FUNC_CODE: + case SQLCOM_SHOW_AUTHORS: case SQLCOM_REPAIR: case SQLCOM_BACKUP_TABLE: case SQLCOM_RESTORE_TABLE: From 78e37021e5ae137174477a57f56d689468ed5601 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Mar 2006 00:15:23 -0800 Subject: [PATCH 13/24] =?UTF-8?q?Bug#14575=20=20=20=C2=A8MySQL=20server=20?= =?UTF-8?q?crashes=20if=20you=20try=20to=20access=20to=20InnoDB=20table?= =?UTF-8?q?=C2=A8=20=20=20crash=20caused=20by=20schizophrenic=20mysqld=20-?= =?UTF-8?q?=202=20memory=20locations=20for=20logically=20same=20function?= =?UTF-8?q?=20=20=20with=20conflicting=20values.=20=20=20Fixed=20by=20back?= =?UTF-8?q?porting=20from=205.1=20changes=20to=20have=5Fxyz=5Fdb=20declara?= =?UTF-8?q?tions.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sql/mysql_priv.h: Backport have_xyz_db changes from 5.1 sql/mysqld.cc: Backport have_xyz_db changes from 5.1 --- sql/mysql_priv.h | 49 ++++++++++++++++++++++++++++++++++++++++++++++-- sql/mysqld.cc | 29 ++++++++++++++++++++++++---- 2 files changed, 72 insertions(+), 6 deletions(-) diff --git a/sql/mysql_priv.h b/sql/mysql_priv.h index 68679cf79dc..32262b3afb2 100644 --- a/sql/mysql_priv.h +++ b/sql/mysql_priv.h @@ -1243,11 +1243,56 @@ extern const LEX_STRING view_type; /* optional things, have_* variables */ -extern SHOW_COMP_OPTION have_isam, have_innodb, have_berkeley_db; -extern SHOW_COMP_OPTION have_example_db, have_archive_db, have_csv_db; +#ifdef HAVE_INNOBASE_DB +extern handlerton innobase_hton; +#define have_innodb innobase_hton.state +#else +extern SHOW_COMP_OPTION have_innodb; +#endif +#ifdef HAVE_BERKELEY_DB +extern handlerton berkeley_hton; +#define have_berkeley_db berkeley_hton.state +#else +extern SHOW_COMP_OPTION have_berkeley_db; +#endif +#ifdef HAVE_EXAMPLE_DB +extern handlerton example_hton; +#define have_example_db example_hton.state +#else +extern SHOW_COMP_OPTION have_example_db; +#endif +#ifdef HAVE_ARCHIVE_DB +extern handlerton archive_hton; +#define have_archive_db archive_hton.state +#else +extern SHOW_COMP_OPTION have_archive_db; +#endif +#ifdef HAVE_CSV_DB +extern handlerton tina_hton; +#define have_csv_db tina_hton.state +#else +extern SHOW_COMP_OPTION have_csv_db; +#endif +#ifdef HAVE_FEDERATED_DB +extern handlerton federated_hton; +#define have_federated_db federated_hton.state +#else extern SHOW_COMP_OPTION have_federated_db; +#endif +#ifdef HAVE_BLACKHOLE_DB +extern handlerton blackhole_hton; +#define have_blackhole_db blackhole_hton.state +#else extern SHOW_COMP_OPTION have_blackhole_db; +#endif +#ifdef HAVE_NDBCLUSTER_DB +extern handlerton ndbcluster_hton; +#define have_ndbcluster ndbcluster_hton.state +#else extern SHOW_COMP_OPTION have_ndbcluster; +#endif + +extern SHOW_COMP_OPTION have_isam; extern SHOW_COMP_OPTION have_raid, have_openssl, have_symlink; extern SHOW_COMP_OPTION have_query_cache; extern SHOW_COMP_OPTION have_geometry, have_rtree_keys; diff --git a/sql/mysqld.cc b/sql/mysqld.cc index a6304d4a30e..e9ff220a6a1 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -472,13 +472,10 @@ CHARSET_INFO *system_charset_info, *files_charset_info ; CHARSET_INFO *national_charset_info, *table_alias_charset; CHARSET_INFO *character_set_filesystem; -SHOW_COMP_OPTION have_berkeley_db, have_innodb, have_isam, have_ndbcluster, - have_example_db, have_archive_db, have_csv_db; -SHOW_COMP_OPTION have_federated_db; +SHOW_COMP_OPTION have_isam; SHOW_COMP_OPTION have_raid, have_openssl, have_symlink, have_query_cache; SHOW_COMP_OPTION have_geometry, have_rtree_keys; SHOW_COMP_OPTION have_crypt, have_compress; -SHOW_COMP_OPTION have_blackhole_db; /* Thread specific variables */ @@ -7396,6 +7393,30 @@ static void create_pid_file() } +/***************************************************************************** + Instantiate have_xyx for missing storage engines +*****************************************************************************/ +#undef have_berkeley_db +#undef have_innodb +#undef have_ndbcluster +#undef have_example_db +#undef have_archive_db +#undef have_csv_db +#undef have_federated_db +#undef have_partition_db +#undef have_blackhole_db + +SHOW_COMP_OPTION have_berkeley_db= SHOW_OPTION_NO; +SHOW_COMP_OPTION have_innodb= SHOW_OPTION_NO; +SHOW_COMP_OPTION have_ndbcluster= SHOW_OPTION_NO; +SHOW_COMP_OPTION have_example_db= SHOW_OPTION_NO; +SHOW_COMP_OPTION have_archive_db= SHOW_OPTION_NO; +SHOW_COMP_OPTION have_csv_db= SHOW_OPTION_NO; +SHOW_COMP_OPTION have_federated_db= SHOW_OPTION_NO; +SHOW_COMP_OPTION have_partition_db= SHOW_OPTION_NO; +SHOW_COMP_OPTION have_blackhole_db= SHOW_OPTION_NO; + + /***************************************************************************** Instantiate templates *****************************************************************************/ From 3b770ea9a4fe9e7843f108e613a108aad1054004 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Mar 2006 09:23:37 +0100 Subject: [PATCH 14/24] Bug#17400 (RBR: replication of delete and update fails for tables w/o PK): Unable to reproduce failure: some of the 17400 tests pass, other have other failures. The test in the bug report passes. Enabling some tests that pass, rebranding others. mysql-test/t/disabled.def: Enabling tests that pass Rebranding disabled tests --- mysql-test/t/disabled.def | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mysql-test/t/disabled.def b/mysql-test/t/disabled.def index 69f916b92d5..ab90b0697ef 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -23,21 +23,21 @@ partition_03ndb : Bug#16385 ps_7ndb : dbug assert in RBR mode when executing test suite #rpl_bit_npk : Bug#13418 rpl_ddl : Bug#15963 SBR does not show "Definer" correctly -rpl_ndb_2innodb : Bugs#17400: delete & update of rows in table without pk fails -rpl_ndb_2myisam : Bugs#17400: delete & update of rows in table without pk fails +rpl_ndb_2innodb : Assert failure in ha_partition::extra() +rpl_ndb_2myisam : Assert failure in ha_partition::extra() rpl_ndb_auto_inc : Bug#17086 #rpl_ndb_basic : Bug#16228 [IN REVIEW] rpl_ndb_blob : interferes with following tests, causing hang rpl_ndb_blob2 : interferes with following tests, causing hang -rpl_ndb_ddl : Bug#17400: delete & update of rows in table without pk fails -rpl_ndb_delete_nowhere : Bug#17400: delete & update of rows in table without pk fails -rpl_ndb_innodb2ndb : Bugs#17400: delete & update of rows in table without pk fails +rpl_ndb_ddl : master hangs +#rpl_ndb_delete_nowhere : Bug#17400: delete & update of rows in table without pk fails +rpl_ndb_innodb2ndb : Bug#18261: Cluster Replication: tests rpl_ndb_xxx2ndb fails rpl_ndb_insert_ignore : Bugs: #17431: INSERT IGNORE INTO returns failed: 1296 -rpl_ndb_myisam2ndb : Bugs#17400: delete & update of rows in table without pk fails +rpl_ndb_myisam2ndb : Bug#18261: Cluster Replication: tests rpl_ndb_xxx2ndb fails #rpl_ndb_log : result not deterministic rpl_ndb_relay_space : Bug#16993 rpl_ndb_multi_update2 : BUG#17738 In progress -rpl_ndb_multi_update3 : Bug#17400: delete & update of rows in table without pk fails +#rpl_ndb_multi_update3 : Bug#17400: delete & update of rows in table without pk fails rpl_ndb_sp007 : Bug #17290 rpl_row_inexist_tbl : Disabled since patch makes this test wait forever rpl_sp : Bug#16456 From fd6d45f0b0de5a8f0767d96d8f12cbca649f454c Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Mar 2006 11:21:18 +0100 Subject: [PATCH 15/24] Fix bug in mysql-test-run.pl in ^C signal handler. mysql-test/lib/mtr_timer.pl: Fix bug where ^C would trigger cleanup handler in both parent and timeout child processes, causing duplicated messages and potential conflicts. --- mysql-test/lib/mtr_timer.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/mysql-test/lib/mtr_timer.pl b/mysql-test/lib/mtr_timer.pl index 709cebd6407..a85ab8c6122 100644 --- a/mysql-test/lib/mtr_timer.pl +++ b/mysql-test/lib/mtr_timer.pl @@ -78,6 +78,12 @@ sub mtr_timer_start($$$) { { # Child, redirect output and exec # FIXME do we need to redirect streams? + + # Don't do the ^C cleanup in the timeout child processes! + # There is actually a race here, if we get ^C after fork(), but before + # clearing the signal handler. + $SIG{INT}= 'DEFAULT'; + $0= "mtr_timer(timers,$name,$duration)"; sleep($duration); exit(0); From f61a649c5e54052b10663424c3f5a3461a5dd10a Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Mar 2006 13:50:00 +0300 Subject: [PATCH 16/24] A post-review fix for Bug#17403 "Events: packets out of order with show create event" sql/sql_lex.h: Add a comment. --- sql/sql_lex.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 59ebdd2a1cc..2bf26683e45 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -53,6 +53,11 @@ class Event_timed; /* When a command is added here, be sure it's also added in mysqld.cc in "struct show_var_st status_vars[]= {" ... + + If the command returns a result set or is not allowed in stored + functions or triggers, please also make sure that + sp_get_flags_for_command (sp_head.cc) returns proper flags for the + added SQLCOM_. */ enum enum_sql_command { From 01cce283a7ce89ac9b0f3866eaafebb8c34e0600 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Mar 2006 03:21:15 -0800 Subject: [PATCH 17/24] BUG#17772 A crash after ALTER TABLE t1 RENAME ... mysql-test/r/partition.result: New test case mysql-test/t/partition.test: New test case sql/sql_lex.h: Introduced like name for CREATE TABLE t1 LIKE t2 sql/sql_parse.cc: Introduced like name for CREATE TABLE t1 LIKE t2 sql/sql_partition.cc: Introduced like name for CREATE TABLE t1 LIKE t2 sql/sql_yacc.yy: Introduced like name for CREATE TABLE t1 LIKE t2 --- mysql-test/r/partition.result | 11 +++++++++++ mysql-test/t/partition.test | 17 +++++++++++++++++ sql/sql_lex.h | 1 + sql/sql_parse.cc | 4 ++-- sql/sql_partition.cc | 6 +++--- sql/sql_yacc.yy | 12 +++++++----- 6 files changed, 41 insertions(+), 10 deletions(-) diff --git a/mysql-test/r/partition.result b/mysql-test/r/partition.result index feed5483827..f31692bea0a 100644 --- a/mysql-test/r/partition.result +++ b/mysql-test/r/partition.result @@ -546,4 +546,15 @@ t1 CREATE TABLE `t1` ( `b` int(11) DEFAULT NULL ) ENGINE=MyISAM DEFAULT CHARSET=latin1 PARTITION BY LIST (a) (PARTITION p1 VALUES IN (1) ENGINE = MyISAM, PARTITION p2 VALUES IN (2) ENGINE = MyISAM) drop table t1; +create table t1 (a int unsigned not null auto_increment primary key) +partition by key(a); +alter table t1 rename t2, add c char(10), comment "no comment"; +show create table t2; +Table Create Table +t2 CREATE TABLE `t2` ( + `a` int(10) unsigned NOT NULL AUTO_INCREMENT, + `c` char(10) DEFAULT NULL, + PRIMARY KEY (`a`) +) ENGINE=MyISAM DEFAULT CHARSET=latin1 COMMENT='no comment' PARTITION BY KEY (a) +drop table t2; End of 5.1 tests diff --git a/mysql-test/t/partition.test b/mysql-test/t/partition.test index bac8b6573e6..73949733426 100644 --- a/mysql-test/t/partition.test +++ b/mysql-test/t/partition.test @@ -697,4 +697,21 @@ alter table t1 add primary key (b); show create table t1; drop table t1; +############################################ +# +# Author: Mikael Ronstrom +# Date: 2006-03-01 +# Purpose +# Bug 17772: Crash at ALTER TABLE with rename +# and add column + comment on +# partitioned table +# +############################################ +create table t1 (a int unsigned not null auto_increment primary key) +partition by key(a); +alter table t1 rename t2, add c char(10), comment "no comment"; +show create table t2; + +drop table t2; + --echo End of 5.1 tests diff --git a/sql/sql_lex.h b/sql/sql_lex.h index 59ebdd2a1cc..954c3be17c6 100644 --- a/sql/sql_lex.h +++ b/sql/sql_lex.h @@ -761,6 +761,7 @@ typedef struct st_lex const uchar *tok_start_prev, *tok_end_prev; char *length,*dec,*change,*name; + Table_ident *like_name; char *help_arg; char *backup_dir; /* For RESTORE/BACKUP */ char* to_log; /* For PURGE MASTER LOGS TO */ diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 871c8bdff9f..96c6c7fa8f3 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -2897,9 +2897,9 @@ mysql_execute_command(THD *thd) else { /* regular create */ - if (lex->name) + if (lex->like_name) res= mysql_create_like_table(thd, create_table, &lex->create_info, - (Table_ident *)lex->name); + lex->like_name); else { res= mysql_create_table(thd, create_table->db, diff --git a/sql/sql_partition.cc b/sql/sql_partition.cc index 18793d43016..03fa046094a 100644 --- a/sql/sql_partition.cc +++ b/sql/sql_partition.cc @@ -3741,14 +3741,14 @@ bool mysql_unpack_partition(THD *thd, const uchar *part_buf, ha_legacy_type(default_db_type))); if (is_create_table_ind) { - if (old_lex->name) + if (old_lex->like_name) { /* This code is executed when we do a CREATE TABLE t1 LIKE t2 - old_lex->name contains the t2 and the table we are opening has + old_lex->like_name contains the t2 and the table we are opening has name t1. */ - Table_ident *table_ident= (Table_ident *)old_lex->name; + Table_ident *table_ident= old_lex->like_name; char *src_db= table_ident->db.str ? table_ident->db.str : thd->db; char *src_table= table_ident->table.str; char buf[FN_REFLEN]; diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index c5b7acb5eb3..15012571369 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1214,7 +1214,8 @@ create: lex->create_info.options=$2 | $4; lex->create_info.db_type= lex->thd->variables.table_type; lex->create_info.default_table_charset= NULL; - lex->name=0; + lex->name= 0; + lex->like_name= 0; } create2 { Lex->current_select= &Lex->select_lex; } @@ -3272,13 +3273,13 @@ create2: | LIKE table_ident { LEX *lex=Lex; - if (!(lex->name= (char *)$2)) + if (!(lex->like_name= $2)) YYABORT; } | '(' LIKE table_ident ')' { LEX *lex=Lex; - if (!(lex->name= (char *)$3)) + if (!(lex->like_name= $3)) YYABORT; } ; @@ -4712,8 +4713,8 @@ alter: { THD *thd= YYTHD; LEX *lex= thd->lex; + lex->name= 0; lex->sql_command= SQLCOM_ALTER_TABLE; - lex->name= 0; lex->duplicates= DUP_ERROR; if (!lex->select_lex.add_table_to_list(thd, $4, NULL, TL_OPTION_UPDATING)) @@ -4722,7 +4723,8 @@ alter: lex->key_list.empty(); lex->col_list.empty(); lex->select_lex.init_order(); - lex->select_lex.db=lex->name=0; + lex->select_lex.db=lex->name= 0; + lex->like_name= 0; bzero((char*) &lex->create_info,sizeof(lex->create_info)); lex->create_info.db_type= (handlerton*) &default_hton; lex->create_info.default_table_charset= NULL; From 06dd976419b982f6ee8bf044c1114b30670e1698 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Mar 2006 13:14:40 +0100 Subject: [PATCH 18/24] fix for bug 16408 (Events: crash for an event in a procedure) (one patch) mysql-test/r/events_bugs.result: fix for bug 16408 mysql-test/t/events_bugs.test: fix for bug 16408 sql/event.h: fix for bug 16408 sql/event_timed.cc: fix for bug 16408 sql/sql_parse.cc: fix for bug 16408 sql/sql_yacc.yy: fix for bug 16408 --- mysql-test/r/events_bugs.result | 14 +++++++++ mysql-test/t/events_bugs.test | 21 ++++++++++++++ sql/event.h | 50 +++++++++++++++++++++++++++++---- sql/event_timed.cc | 7 +++-- sql/sql_parse.cc | 19 +++++++++---- sql/sql_yacc.yy | 8 +++--- 6 files changed, 100 insertions(+), 19 deletions(-) diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index 0b554f97b9a..f7100f20524 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -1,5 +1,19 @@ create database if not exists events_test; use events_test; +set @a=3; +CREATE PROCEDURE p_16 () CREATE EVENT e_16 ON SCHEDULE EVERY @a SECOND DO SET @a=5; +call p_16(); +"Here we used to crash!" +call p_16(); +ERROR HY000: Event 'e_16' already exists +call p_16(); +ERROR HY000: Event 'e_16' already exists +DROP EVENT e_16; +CALL p_16(); +CALL p_16(); +ERROR HY000: Event 'e_16' already exists +DROP PROCEDURE p_16; +DROP EVENT e_16; set global event_scheduler=0; "Wait a bit to settle down" delete from mysql.event; diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index 2d4374dcb41..4214d8483d1 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -1,5 +1,26 @@ create database if not exists events_test; use events_test; +# +# START - BUG#16408: Events: crash for an event in a procedure +# +set @a=3; +CREATE PROCEDURE p_16 () CREATE EVENT e_16 ON SCHEDULE EVERY @a SECOND DO SET @a=5; +call p_16(); +--echo "Here we used to crash!" +--error 1516 +call p_16(); +--error 1516 +call p_16(); +DROP EVENT e_16; +CALL p_16(); +--error 1516 +CALL p_16(); +DROP PROCEDURE p_16; +DROP EVENT e_16; +# +# END - BUG#16408: Events: crash for an event in a procedure +# + # # Start - 16407: Events: Changes in sql_mode won't be taken into account # diff --git a/sql/event.h b/sql/event.h index d070f93c575..27de8b46e32 100644 --- a/sql/event.h +++ b/sql/event.h @@ -40,7 +40,6 @@ #define EVENT_EXEC_NO_MORE (1L << 0) #define EVENT_NOT_USED (1L << 1) - extern ulong opt_event_executor; enum enum_event_on_completion @@ -122,6 +121,39 @@ public: bool free_sphead_on_delete; uint flags;//all kind of purposes + static void *operator new(size_t size) + { + void *p; + DBUG_ENTER("Event_timed::new(size)"); + p= my_malloc(size, MYF(0)); + DBUG_PRINT("info", ("alloc_ptr=0x%lx", p)); + DBUG_RETURN(p); + } + + static void *operator new(size_t size, MEM_ROOT *mem_root) + { return (void*) alloc_root(mem_root, (uint) size); } + + static void operator delete(void *ptr, size_t size) + { + DBUG_ENTER("Event_timed::delete(ptr,size)"); + DBUG_PRINT("enter", ("free_ptr=0x%lx", ptr)); + TRASH(ptr, size); + my_free((gptr) ptr, MYF(0)); + DBUG_VOID_RETURN; + } + + static void operator delete(void *ptr, MEM_ROOT *mem_root) + { + /* + Don't free the memory it will be done by the mem_root but + we need to call the destructor because we free other resources + which are not allocated on the root but on the heap, or we + deinit mutexes. + */ + DBUG_ASSERT(0); + } + + Event_timed():in_spawned_thread(0),locked_by_thread_id(0), running(0), status_changed(false), last_executed_changed(false), expression(0), created(0), @@ -136,15 +168,21 @@ public: } ~Event_timed() - { - pthread_mutex_destroy(&this->LOCK_running); - if (free_sphead_on_delete) - free_sp(); - } + { + deinit_mutexes(); + if (free_sphead_on_delete) + free_sp(); + } void init(); + + void + deinit_mutexes() + { + pthread_mutex_destroy(&this->LOCK_running); + } int init_definer(THD *thd); diff --git a/sql/event_timed.cc b/sql/event_timed.cc index 8348a75914e..b0e818a4e48 100644 --- a/sql/event_timed.cc +++ b/sql/event_timed.cc @@ -1228,12 +1228,12 @@ Event_timed::change_security_context(THD *thd, Security_context *s_ctx, definer_host.str, dbname.str)) { my_error(ER_NO_SUCH_USER, MYF(0), definer_user.str, definer_host.str); - DBUG_RETURN(TRUE); + DBUG_RETURN(true); } *backup= thd->security_ctx; thd->security_ctx= s_ctx; #endif - DBUG_RETURN(FALSE); + DBUG_RETURN(false); } @@ -1368,7 +1368,8 @@ Event_timed::compile(THD *thd, MEM_ROOT *mem_root) ret= 0; done: lex.et->free_sphead_on_delete= false; - delete lex.et; + lex.et->deinit_mutexes(); + lex_end(&lex); DBUG_PRINT("note", ("return old data on its place. set back NAMES")); diff --git a/sql/sql_parse.cc b/sql/sql_parse.cc index 871c8bdff9f..3b5757aef6e 100644 --- a/sql/sql_parse.cc +++ b/sql/sql_parse.cc @@ -3803,10 +3803,14 @@ end_with_restore_list: send_ok(thd, rows_affected); /* lex->unit.cleanup() is called outside, no need to call it here */ - } while (0); - lex->et->free_sphead_on_delete= true; - delete lex->et; - lex->et= 0; + } while (0); + if (!thd->spcont) + { + lex->et->free_sphead_on_delete= true; + lex->et->free_sp(); + lex->et->deinit_mutexes(); + } + break; } case SQLCOM_SHOW_CREATE_EVENT: @@ -5845,7 +5849,9 @@ void mysql_parse(THD *thd, char *inBuf, uint length) if (thd->lex->et) { thd->lex->et->free_sphead_on_delete= true; - delete thd->lex->et; + /* alloced on thd->mem_root so no real memory free but dtor call */ + thd->lex->et->free_sp(); + thd->lex->et->deinit_mutexes(); thd->lex->et= NULL; } } @@ -5886,7 +5892,8 @@ void mysql_parse(THD *thd, char *inBuf, uint length) if (thd->lex->et) { thd->lex->et->free_sphead_on_delete= true; - delete thd->lex->et; + lex->et->free_sp(); + lex->et->deinit_mutexes(); thd->lex->et= NULL; } } diff --git a/sql/sql_yacc.yy b/sql/sql_yacc.yy index c5b7acb5eb3..944b3b45f20 100644 --- a/sql/sql_yacc.yy +++ b/sql/sql_yacc.yy @@ -1274,7 +1274,7 @@ create: lex->create_info.options= $3; - if (!(lex->et= new Event_timed())) // implicitly calls Event_timed::init() + if (!(lex->et= new(YYTHD->mem_root) Event_timed())) // implicitly calls Event_timed::init() YYABORT; /* @@ -4811,7 +4811,7 @@ alter: } lex->spname= 0;//defensive programming - if (!(et= new Event_timed()))// implicitly calls Event_timed::init() + if (!(et= new (YYTHD->mem_root) Event_timed()))// implicitly calls Event_timed::init() YYABORT; lex->et = et; @@ -7715,7 +7715,7 @@ drop: YYABORT; } - if (!(lex->et= new Event_timed())) + if (!(lex->et= new (YYTHD->mem_root) Event_timed())) YYABORT; if (!lex->et_compile_phase) @@ -8439,7 +8439,7 @@ show_param: { Lex->sql_command = SQLCOM_SHOW_CREATE_EVENT; Lex->spname= $3; - Lex->et= new Event_timed(); + Lex->et= new (YYTHD->mem_root) Event_timed(); if (!Lex->et) YYABORT; Lex->et->init_definer(YYTHD); From 6091d5c7a0362bdd2d9ae30768036922b9b0ba81 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Mar 2006 13:30:59 +0100 Subject: [PATCH 19/24] Fix Windows CMake dependency problem. client/cmakelists.txt: Fix dependency problem with the old GenError target. extra/cmakelists.txt: Fix dependency problem with the old GenError target. libmysql/cmakelists.txt: Fix dependency problem with the old GenError target. server-tools/instance-manager/cmakelists.txt: Fix dependency problem with the old GenError target. sql/cmakelists.txt: Fix dependency problem with the old GenError target. win/README: Fix dependency problem with the old GenError target. --- client/cmakelists.txt | 2 +- extra/cmakelists.txt | 20 ++++++++++---------- libmysql/cmakelists.txt | 2 +- server-tools/instance-manager/cmakelists.txt | 2 +- sql/cmakelists.txt | 2 +- win/README | 9 ++------- 6 files changed, 16 insertions(+), 21 deletions(-) diff --git a/client/cmakelists.txt b/client/cmakelists.txt index 5da9189b0ae..9c9e56d9b43 100644 --- a/client/cmakelists.txt +++ b/client/cmakelists.txt @@ -48,7 +48,7 @@ ADD_LIBRARY(mysqlclient ../mysys/array.c ../strings/bchange.c ../strings/bmove.c ../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c) -ADD_DEPENDENCIES(mysqlclient GenError) +ADD_DEPENDENCIES(mysqlclient comp_err) ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc) LINK_DIRECTORIES(${MYSQL_BINARY_DIR}/mysys ${MYSQL_BINARY_DIR}/zlib) TARGET_LINK_LIBRARIES(mysql mysqlclient mysys yassl zlib dbug yassl taocrypt wsock32) diff --git a/extra/cmakelists.txt b/extra/cmakelists.txt index d31779fca63..0f7005da079 100644 --- a/extra/cmakelists.txt +++ b/extra/cmakelists.txt @@ -8,16 +8,16 @@ TARGET_LINK_LIBRARIES(comp_err dbug mysys strings wsock32) GET_TARGET_PROPERTY(COMP_ERR_EXE comp_err LOCATION) -ADD_CUSTOM_TARGET(GenError - ${COMP_ERR_EXE} --charset=${PROJECT_SOURCE_DIR}/sql/share/charsets - --out-dir=${PROJECT_SOURCE_DIR}/sql/share/ - --header_file=${PROJECT_SOURCE_DIR}/include/mysqld_error.h - --name_file=${PROJECT_SOURCE_DIR}/include/mysqld_ername.h - --state_file=${PROJECT_SOURCE_DIR}/include/sql_state.h - --in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt - DEPENDS comp_err ${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt) - - +ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/include/mysqld_error.h + COMMAND ${COMP_ERR_EXE} + --charset=${PROJECT_SOURCE_DIR}/sql/share/charsets + --out-dir=${PROJECT_SOURCE_DIR}/sql/share/ + --header_file=${PROJECT_SOURCE_DIR}/include/mysqld_error.h + --name_file=${PROJECT_SOURCE_DIR}/include/mysqld_ername.h + --state_file=${PROJECT_SOURCE_DIR}/include/sql_state.h + --in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt + MAIN_DEPENDENCY comp_err + DEPENDS ${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt) ADD_EXECUTABLE(my_print_defaults my_print_defaults.c) TARGET_LINK_LIBRARIES(my_print_defaults strings mysys dbug taocrypt odbc32 odbccp32 wsock32) diff --git a/libmysql/cmakelists.txt b/libmysql/cmakelists.txt index cb3453fc222..b6e10306f6d 100644 --- a/libmysql/cmakelists.txt +++ b/libmysql/cmakelists.txt @@ -45,7 +45,7 @@ ADD_LIBRARY(libmysql MODULE dll.c libmysql.def ../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c ../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c) -ADD_DEPENDENCIES(libmysql dbug vio mysys strings GenError zlib) +ADD_DEPENDENCIES(libmysql dbug vio mysys strings comp_err zlib) TARGET_LINK_LIBRARIES(libmysql mysys strings wsock32) # ToDo: We should move the mytest.c program out in libmysql/ diff --git a/server-tools/instance-manager/cmakelists.txt b/server-tools/instance-manager/cmakelists.txt index 32f243b43d9..ff6a1077166 100644 --- a/server-tools/instance-manager/cmakelists.txt +++ b/server-tools/instance-manager/cmakelists.txt @@ -12,5 +12,5 @@ ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instanc ../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c ../../libmysql/errmsg.c) -ADD_DEPENDENCIES(mysqlmanager GenError) +ADD_DEPENDENCIES(mysqlmanager comp_err) TARGET_LINK_LIBRARIES(mysqlmanager dbug mysys strings taocrypt vio yassl zlib wsock32) diff --git a/sql/cmakelists.txt b/sql/cmakelists.txt index 2099ef94996..89462a018e6 100644 --- a/sql/cmakelists.txt +++ b/sql/cmakelists.txt @@ -50,7 +50,7 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc discover. ${PROJECT_SOURCE_DIR}/sql/handlerton.cc ${PROJECT_SOURCE_DIR}/sql/lex_hash.h) TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg innobase mysys yassl zlib dbug yassl taocrypt strings vio regex wsock32) -ADD_DEPENDENCIES(mysqld GenError) +ADD_DEPENDENCIES(mysqld comp_err) # Sql Parser custom command ADD_CUSTOM_COMMAND( diff --git a/win/README b/win/README index c8eed8e93fe..27c7e5c5762 100644 --- a/win/README +++ b/win/README @@ -60,16 +60,11 @@ click the build solution menu option. Current issues -------------- -1. Dependencies are not handled correctly with the current scripts. What -this means is that a new error file may not be generated when the errmsg.txt -file changes. In this case, simply force the GenError target to build. This -should execute comp_err to generate the required files. - -2. Not all configurations are currently available. i.e. Classic, Pro, Max. +1. Not all configurations are currently available. i.e. Classic, Pro, Max. Currently, only debug and release are available. This will change in the near future. -3. The definitions set for features (partitioning, blackhole, etc) are not +2. The definitions set for features (partitioning, blackhole, etc) are not changed based on the options given with configure. This will soon be fixed as well. From 40eb9b875cc01318a3e34af0ace99217308ccd24 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Mar 2006 15:42:48 +0100 Subject: [PATCH 20/24] CMake Windows comp_error dependency fix after last push. extra/cmakelists.txt: Another attempt at fixing the comp_err/GenError dependency problem. sql/cmakelists.txt: Another attempt at fixing the comp_err/GenError dependency problem. client/cmakelists.txt: Another attempt at fixing the comp_err/GenError dependency problem. libmysql/cmakelists.txt: Another attempt at fixing the comp_err/GenError dependency problem. server-tools/instance-manager/cmakelists.txt: Another attempt at fixing the comp_err/GenError dependency problem. --- client/cmakelists.txt | 2 +- extra/cmakelists.txt | 7 +++++-- libmysql/cmakelists.txt | 2 +- server-tools/instance-manager/cmakelists.txt | 2 +- sql/cmakelists.txt | 2 +- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/client/cmakelists.txt b/client/cmakelists.txt index 9c9e56d9b43..5da9189b0ae 100644 --- a/client/cmakelists.txt +++ b/client/cmakelists.txt @@ -48,7 +48,7 @@ ADD_LIBRARY(mysqlclient ../mysys/array.c ../strings/bchange.c ../strings/bmove.c ../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c) -ADD_DEPENDENCIES(mysqlclient comp_err) +ADD_DEPENDENCIES(mysqlclient GenError) ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc) LINK_DIRECTORIES(${MYSQL_BINARY_DIR}/mysys ${MYSQL_BINARY_DIR}/zlib) TARGET_LINK_LIBRARIES(mysql mysqlclient mysys yassl zlib dbug yassl taocrypt wsock32) diff --git a/extra/cmakelists.txt b/extra/cmakelists.txt index 0f7005da079..50e0f04eb14 100644 --- a/extra/cmakelists.txt +++ b/extra/cmakelists.txt @@ -16,8 +16,11 @@ ADD_CUSTOM_COMMAND(OUTPUT ${PROJECT_SOURCE_DIR}/include/mysqld_error.h --name_file=${PROJECT_SOURCE_DIR}/include/mysqld_ername.h --state_file=${PROJECT_SOURCE_DIR}/include/sql_state.h --in_file=${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt - MAIN_DEPENDENCY comp_err - DEPENDS ${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt) + DEPENDS comp_err ${PROJECT_SOURCE_DIR}/sql/share/errmsg.txt) + +ADD_CUSTOM_TARGET(GenError + ALL + 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) diff --git a/libmysql/cmakelists.txt b/libmysql/cmakelists.txt index b6e10306f6d..cb3453fc222 100644 --- a/libmysql/cmakelists.txt +++ b/libmysql/cmakelists.txt @@ -45,7 +45,7 @@ ADD_LIBRARY(libmysql MODULE dll.c libmysql.def ../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c ../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c) -ADD_DEPENDENCIES(libmysql dbug vio mysys strings comp_err zlib) +ADD_DEPENDENCIES(libmysql dbug vio mysys strings GenError zlib) TARGET_LINK_LIBRARIES(libmysql mysys strings wsock32) # ToDo: We should move the mytest.c program out in libmysql/ diff --git a/server-tools/instance-manager/cmakelists.txt b/server-tools/instance-manager/cmakelists.txt index ff6a1077166..32f243b43d9 100644 --- a/server-tools/instance-manager/cmakelists.txt +++ b/server-tools/instance-manager/cmakelists.txt @@ -12,5 +12,5 @@ ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instanc ../../sql/sql_state.c ../../sql-common/client.c ../../libmysql/get_password.c ../../libmysql/errmsg.c) -ADD_DEPENDENCIES(mysqlmanager comp_err) +ADD_DEPENDENCIES(mysqlmanager GenError) TARGET_LINK_LIBRARIES(mysqlmanager dbug mysys strings taocrypt vio yassl zlib wsock32) diff --git a/sql/cmakelists.txt b/sql/cmakelists.txt index 89462a018e6..2099ef94996 100644 --- a/sql/cmakelists.txt +++ b/sql/cmakelists.txt @@ -50,7 +50,7 @@ ADD_EXECUTABLE(mysqld ../sql-common/client.c derror.cc des_key_file.cc discover. ${PROJECT_SOURCE_DIR}/sql/handlerton.cc ${PROJECT_SOURCE_DIR}/sql/lex_hash.h) TARGET_LINK_LIBRARIES(mysqld heap myisam myisammrg innobase mysys yassl zlib dbug yassl taocrypt strings vio regex wsock32) -ADD_DEPENDENCIES(mysqld comp_err) +ADD_DEPENDENCIES(mysqld GenError) # Sql Parser custom command ADD_CUSTOM_COMMAND( From e087df2fa3e791e89527f735a5d7a032d2c76787 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Mar 2006 16:03:39 +0100 Subject: [PATCH 21/24] Remove disabling of rpl_ndb_multi_update2 --- 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 ab90b0697ef..2c6973b4558 100644 --- a/mysql-test/t/disabled.def +++ b/mysql-test/t/disabled.def @@ -36,7 +36,6 @@ rpl_ndb_insert_ignore : Bugs: #17431: INSERT IGNORE INTO returns failed: 1296 rpl_ndb_myisam2ndb : Bug#18261: Cluster Replication: tests rpl_ndb_xxx2ndb fails #rpl_ndb_log : result not deterministic rpl_ndb_relay_space : Bug#16993 -rpl_ndb_multi_update2 : BUG#17738 In progress #rpl_ndb_multi_update3 : Bug#17400: delete & update of rows in table without pk fails rpl_ndb_sp007 : Bug #17290 rpl_row_inexist_tbl : Disabled since patch makes this test wait forever From 617053a40ba7f02f444de6e89a22dd494c86bd78 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Mar 2006 16:25:16 +0100 Subject: [PATCH 22/24] Fix example storage engine build on Windows. --- VC++Files/storage/example/example.vcproj | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/VC++Files/storage/example/example.vcproj b/VC++Files/storage/example/example.vcproj index 257a1e77b71..81353cb759b 100644 --- a/VC++Files/storage/example/example.vcproj +++ b/VC++Files/storage/example/example.vcproj @@ -23,7 +23,7 @@ Optimization="2" InlineFunctionExpansion="1" OptimizeForProcessor="2" - AdditionalIncludeDirectories="../../include,../../regex,../../sql" + AdditionalIncludeDirectories="../../include,../../regex,../../sql,../../extra/yassl/include" PreprocessorDefinitions="DBUG_OFF;_WINDOWS;NDEBUG;WITH_PARTITION_STORAGE_ENGINE" StringPooling="TRUE" RuntimeLibrary="0" @@ -72,7 +72,7 @@ Name="VCCLCompilerTool" Optimization="0" OptimizeForProcessor="2" - AdditionalIncludeDirectories="../../include,../../regex,../../sql" + AdditionalIncludeDirectories="../../include,../../regex,../../sql,../../extra/yassl/include" PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;USE_TLS;WITH_PARTITION_STORAGE_ENGINE" StringPooling="TRUE" RuntimeLibrary="1" @@ -122,7 +122,7 @@ Optimization="2" InlineFunctionExpansion="1" OptimizeForProcessor="2" - AdditionalIncludeDirectories="../../include,../../regex,../../sql" + AdditionalIncludeDirectories="../../include,../../regex,../../sql,../../extra/yassl/include" PreprocessorDefinitions="DBUG_OFF;_WINDOWS;NDEBUG;USE_TLS;WITH_PARTITION_STORAGE_ENGINE" StringPooling="TRUE" RuntimeLibrary="0" @@ -171,7 +171,7 @@ Name="VCCLCompilerTool" Optimization="0" OptimizeForProcessor="2" - AdditionalIncludeDirectories="../../include,../../regex,../../sql" + AdditionalIncludeDirectories="../../include,../../regex,../../sql,../../extra/yassl/include" PreprocessorDefinitions="_DEBUG;SAFEMALLOC;SAFE_MUTEX;_WINDOWS;WITH_PARTITION_STORAGE_ENGINE" StringPooling="TRUE" RuntimeLibrary="1" From 511f3b7a6d7e1b4f4f3e058520d172dc33dd3c64 Mon Sep 17 00:00:00 2001 From: unknown Date: Thu, 16 Mar 2006 16:57:24 +0100 Subject: [PATCH 23/24] Fix Windows CMake compilation after merge of Magnuses ssl patch. --- client/cmakelists.txt | 18 +++++++++--------- libmysql/cmakelists.txt | 2 +- server-tools/instance-manager/cmakelists.txt | 3 ++- tests/cmakelists.txt | 2 +- 4 files changed, 13 insertions(+), 12 deletions(-) diff --git a/client/cmakelists.txt b/client/cmakelists.txt index 5da9189b0ae..26cc36c7f6f 100644 --- a/client/cmakelists.txt +++ b/client/cmakelists.txt @@ -51,30 +51,30 @@ ADD_LIBRARY(mysqlclient ../mysys/array.c ../strings/bchange.c ../strings/bmove.c ADD_DEPENDENCIES(mysqlclient GenError) ADD_EXECUTABLE(mysql completion_hash.cc mysql.cc readline.cc sql_string.cc) LINK_DIRECTORIES(${MYSQL_BINARY_DIR}/mysys ${MYSQL_BINARY_DIR}/zlib) -TARGET_LINK_LIBRARIES(mysql mysqlclient mysys yassl zlib dbug yassl taocrypt wsock32) +TARGET_LINK_LIBRARIES(mysql mysqlclient mysys yassl taocrypt zlib dbug wsock32) ADD_EXECUTABLE(mysqltest mysqltest.c) -TARGET_LINK_LIBRARIES(mysqltest mysqlclient mysys yassl zlib dbug regex wsock32) +TARGET_LINK_LIBRARIES(mysqltest mysqlclient mysys yassl taocrypt zlib dbug regex wsock32) ADD_EXECUTABLE(mysqlcheck mysqlcheck.c) -TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient dbug yassl zlib wsock32) +TARGET_LINK_LIBRARIES(mysqlcheck mysqlclient dbug yassl taocrypt zlib wsock32) ADD_EXECUTABLE(mysqldump mysqldump.c ../sql-common/my_user.c) -TARGET_LINK_LIBRARIES(mysqldump mysqlclient mysys dbug yassl zlib wsock32) +TARGET_LINK_LIBRARIES(mysqldump mysqlclient mysys dbug yassl taocrypt zlib wsock32) ADD_EXECUTABLE(mysqlimport mysqlimport.c) -TARGET_LINK_LIBRARIES(mysqlimport mysqlclient mysys dbug yassl zlib wsock32) +TARGET_LINK_LIBRARIES(mysqlimport mysqlclient mysys dbug yassl taocrypt zlib wsock32) ADD_EXECUTABLE(mysqlshow mysqlshow.c) -TARGET_LINK_LIBRARIES(mysqlshow mysqlclient mysys dbug yassl zlib wsock32) +TARGET_LINK_LIBRARIES(mysqlshow mysqlclient mysys dbug yassl taocrypt zlib wsock32) ADD_EXECUTABLE(mysqlbinlog mysqlbinlog.cc ../mysys/mf_tempdir.c ../mysys/my_new.cc ../mysys/my_bit.c ../mysys/my_bitmap.c ../mysys/my_vle.c ../mysys/base64.c) -TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient dbug yassl zlib wsock32) +TARGET_LINK_LIBRARIES(mysqlbinlog mysqlclient dbug yassl taocrypt zlib wsock32) ADD_EXECUTABLE(mysqladmin mysqladmin.cc) -TARGET_LINK_LIBRARIES(mysqladmin mysqlclient mysys dbug yassl zlib wsock32) +TARGET_LINK_LIBRARIES(mysqladmin mysqlclient mysys dbug yassl taocrypt zlib wsock32) ADD_EXECUTABLE(mysqlslap mysqlslap.c) -TARGET_LINK_LIBRARIES(mysqlslap mysqlclient mysys zlib wsock32 dbug) +TARGET_LINK_LIBRARIES(mysqlslap mysqlclient mysys yassl taocrypt zlib wsock32 dbug) diff --git a/libmysql/cmakelists.txt b/libmysql/cmakelists.txt index cb3453fc222..006eac2fbb9 100644 --- a/libmysql/cmakelists.txt +++ b/libmysql/cmakelists.txt @@ -45,7 +45,7 @@ ADD_LIBRARY(libmysql MODULE dll.c libmysql.def ../strings/strtoll.c ../strings/strtoull.c ../strings/strxmov.c ../strings/strxnmov.c ../mysys/thr_mutex.c ../mysys/typelib.c ../vio/vio.c ../vio/viosocket.c ../vio/viossl.c ../vio/viosslfactories.c ../strings/xml.c) -ADD_DEPENDENCIES(libmysql dbug vio mysys strings GenError zlib) +ADD_DEPENDENCIES(libmysql dbug vio mysys strings GenError zlib yassl taocrypt) TARGET_LINK_LIBRARIES(libmysql mysys strings wsock32) # ToDo: We should move the mytest.c program out in libmysql/ diff --git a/server-tools/instance-manager/cmakelists.txt b/server-tools/instance-manager/cmakelists.txt index 32f243b43d9..c20b9c7f9df 100644 --- a/server-tools/instance-manager/cmakelists.txt +++ b/server-tools/instance-manager/cmakelists.txt @@ -2,7 +2,8 @@ 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 -DMYSQL_INSTANCE_MANAGER) -INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql) +INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR}/sql + ${PROJECT_SOURCE_DIR}/extra/yassl/include) ADD_EXECUTABLE(mysqlmanager buffer.cc command.cc commands.cc guardian.cc instance.cc instance_map.cc instance_options.cc listener.cc log.cc manager.cc messages.cc mysql_connection.cc diff --git a/tests/cmakelists.txt b/tests/cmakelists.txt index 1b627329028..c9b0b8735a2 100644 --- a/tests/cmakelists.txt +++ b/tests/cmakelists.txt @@ -6,4 +6,4 @@ ADD_DEFINITIONS("-DMYSQL_CLIENT") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include) ADD_EXECUTABLE(mysql_client_test mysql_client_test.c) -TARGET_LINK_LIBRARIES(mysql_client_test dbug mysqlclient zlib wsock32) +TARGET_LINK_LIBRARIES(mysql_client_test dbug mysqlclient yassl taocrypt zlib wsock32) From 647eefca2cdc9187cece159a804d0fdf92187ab6 Mon Sep 17 00:00:00 2001 From: unknown Date: Fri, 17 Mar 2006 11:01:45 +0100 Subject: [PATCH 24/24] fix after manual merge of fix for bug #16396: Events: Distant-future dates become past dates. mysql-test/r/events.result: update result mysql-test/r/events_bugs.result: update result after manual merge mysql-test/t/events.test: move from error number to a constant mysql-test/t/events_bugs.test: update error codes --- mysql-test/r/events.result | 42 +++++++++++++++++---------------- mysql-test/r/events_bugs.result | 2 -- mysql-test/t/events.test | 16 ++++++------- mysql-test/t/events_bugs.test | 6 ++--- 4 files changed, 33 insertions(+), 33 deletions(-) diff --git a/mysql-test/r/events.result b/mysql-test/r/events.result index ced21440686..3da724448bf 100644 --- a/mysql-test/r/events.result +++ b/mysql-test/r/events.result @@ -116,80 +116,80 @@ 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 `events_test`.`root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND ON COMPLETION PRESERVE ENABLE COMMENT 'some comment' DO select 1 +root6 CREATE EVENT `root6` ON SCHEDULE EVERY '10:20' MINUTE_SECOND 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 `events_test`.`root7` ON SCHEDULE EVERY 2 YEAR ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root7 CREATE EVENT `root7` ON SCHEDULE EVERY 2 YEAR 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 `events_test`.`root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root8 CREATE EVENT `root8` ON SCHEDULE EVERY '2-5' YEAR_MONTH 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 `events_test`.`root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root8_1 CREATE EVENT `root8_1` ON SCHEDULE EVERY '3-3' YEAR_MONTH 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 `events_test`.`root9` ON SCHEDULE EVERY 2 WEEK ON COMPLETION PRESERVE DISABLE COMMENT 'коментар на кирилица' DO select 1 +root9 CREATE EVENT `root9` ON SCHEDULE EVERY 2 WEEK 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 `events_test`.`root10` ON SCHEDULE EVERY '20 5' DAY_HOUR ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root10 CREATE EVENT `root10` ON SCHEDULE EVERY '20 5' DAY_HOUR 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 `events_test`.`root11` ON SCHEDULE EVERY '21 1' DAY_HOUR ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root11 CREATE EVENT `root11` ON SCHEDULE EVERY '21 1' DAY_HOUR 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 `events_test`.`root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root12 CREATE EVENT `root12` ON SCHEDULE EVERY '20:25' HOUR_MINUTE 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 `events_test`.`root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root13 CREATE EVENT `root13` ON SCHEDULE EVERY '25:25' HOUR_MINUTE 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 `events_test`.`root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root13_1 CREATE EVENT `root13_1` ON SCHEDULE EVERY '12:5' HOUR_MINUTE 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 `events_test`.`root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root14 CREATE EVENT `root14` ON SCHEDULE EVERY '35:35' MINUTE_SECOND 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 `events_test`.`root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root15 CREATE EVENT `root15` ON SCHEDULE EVERY '36:6' MINUTE_SECOND 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 `events_test`.`root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root16 CREATE EVENT `root16` ON SCHEDULE EVERY '1 11:56' DAY_MINUTE 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 `events_test`.`root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root17 CREATE EVENT `root17` ON SCHEDULE EVERY '35 12:45' DAY_MINUTE 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 `events_test`.`root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root17_1 CREATE EVENT `root17_1` ON SCHEDULE EVERY '36 2:5' DAY_MINUTE 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 `events_test`.`root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root18 CREATE EVENT `root18` ON SCHEDULE EVERY '35:12:45' HOUR_SECOND 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 `events_test`.`root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root19 CREATE EVENT `root19` ON SCHEDULE EVERY '16:0:25' HOUR_SECOND 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 `events_test`.`root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND ON COMPLETION NOT PRESERVE ENABLE DO select 1 +root20 CREATE EVENT `root20` ON SCHEDULE EVERY '50 20:12:45' DAY_SECOND 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 `events_test`.`ðóóò21` ON SCHEDULE EVERY '51 0:0:35' DAY_SECOND ON COMPLETION NOT PRESERVE ENABLE COMMENT 'òîâà å 1251 êîìåíòàð' DO select 1 +ðóóò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"); show create event root22; ERROR 42000: This version of MySQL doesn't yet support 'MICROSECOND' @@ -260,8 +260,10 @@ ALTER TABLE mysql.event MODIFY db char(64) character set utf8 collate utf8_bin d "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 +events_test intact_check root@localhost RECURRING NULL 10 HOUR # # ENABLED ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default ''; +Warnings: +Warning 1265 Data truncated for column 'db' at row 1 SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; ERROR HY000: Cannot load from mysql.event. Table probably corrupted. See error log. ALTER TABLE mysql.event MODIFY db varchar(64) character set utf8 collate utf8_bin default ''; diff --git a/mysql-test/r/events_bugs.result b/mysql-test/r/events_bugs.result index 207e8be6914..53f7cdfd0ee 100644 --- a/mysql-test/r/events_bugs.result +++ b/mysql-test/r/events_bugs.result @@ -1,6 +1,5 @@ create database if not exists events_test; use events_test; - set @a=3; CREATE PROCEDURE p_16 () CREATE EVENT e_16 ON SCHEDULE EVERY @a SECOND DO SET @a=5; call p_16(); @@ -15,7 +14,6 @@ CALL p_16(); ERROR HY000: Event 'e_16' already exists DROP PROCEDURE p_16; DROP EVENT e_16; - 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/t/events.test b/mysql-test/t/events.test index d9d8d75ff8c..6036dcb3000 100644 --- a/mysql-test/t/events.test +++ b/mysql-test/t/events.test @@ -190,10 +190,10 @@ 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 1525 +--error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED SHOW EVENTS; ALTER TABLE mysql.event DROP dummy, ADD dummy2 VARCHAR(64) FIRST; ---error 1525 +--error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED SHOW EVENTS; ALTER TABLE mysql.event DROP dummy2; --replace_column 8 # 9 # @@ -206,7 +206,7 @@ ALTER TABLE mysql.event MODIFY db char(20) character set utf8 collate utf8_bin d #wait a bit or we won't see the difference because of seconds resolution --sleep 1 SHOW CREATE TABLE mysql.event; ---error 1526 +--error ER_CANNOT_LOAD_FROM_TABLE SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; --sleep 1 ALTER TABLE mysql.event MODIFY db char(64) character set utf8 collate utf8_bin default ''; @@ -216,16 +216,16 @@ ALTER TABLE mysql.event MODIFY db char(64) character set utf8 collate utf8_bin d SHOW EVENTS; --sleep 1 ALTER TABLE mysql.event MODIFY db char(64) character set cp1251 default ''; ---error 1526 +--error ER_CANNOT_LOAD_FROM_TABLE SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; --sleep 1 ALTER TABLE mysql.event MODIFY db varchar(64) character set utf8 collate utf8_bin default ''; ---error 1526 +--error ER_CANNOT_LOAD_FROM_TABLE SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; --sleep 1 ALTER TABLE mysql.event DROP comment, DROP starts; --sleep 1 ---error 1525 +--error ER_COL_COUNT_DOESNT_MATCH_CORRUPTED SELECT event_name FROM INFORMATION_SCHEMA.EVENTS; DROP TABLE mysql.event; CREATE TABLE mysql.event like event_like; @@ -317,9 +317,9 @@ drop event one_event; 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; drop event e_26; ---error 1503 +--error 1504 create event e_26 on schedule at NULL disabled do set @a = 5; ---error 1503 +--error 1504 create event e_26 on schedule at 'definitely not a datetime' disabled do set @a = 5; set names utf8; diff --git a/mysql-test/t/events_bugs.test b/mysql-test/t/events_bugs.test index 3fd03adced2..384b648761a 100644 --- a/mysql-test/t/events_bugs.test +++ b/mysql-test/t/events_bugs.test @@ -24,11 +24,11 @@ DROP EVENT e_16; # # Start - 16396: Events: Distant-future dates become past dates # ---error 1503 +--error 1504 create event e_55 on schedule at 99990101000000 do drop table t; ---error 1503 +--error 1504 create event e_55 on schedule every 10 hour starts 99990101000000 do drop table t; ---error 1521 +--error ER_EVENT_ENDS_BEFORE_STARTS create event e_55 on schedule every 10 minute ends 99990101000000 do drop table t; # # End - 16396: Events: Distant-future dates become past dates