From af660df0ef0772ed48062880f94d68c53a2da8d7 Mon Sep 17 00:00:00 2001 From: "evgen@sunlight.local" <> Date: Mon, 13 Mar 2006 21:11:15 +0300 Subject: [PATCH 01/17] 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/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 42a3ff3f99c0e7851697420834edb2dc9e74a3ba Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Tue, 14 Mar 2006 14:51:48 +0100 Subject: [PATCH 02/17] Bug#18195 MySQL on Windows not built with YaSSL correctly - Add HAVE_OPENSSL and HAVE_YASSL to config-win.h --- 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 a152cac2e7d783f759698133e39bdf2c0707e93e Mon Sep 17 00:00:00 2001 From: "evgen@sunlight.local" <> Date: Tue, 14 Mar 2006 18:49:37 +0300 Subject: [PATCH 03/17] 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 bea2ca46b3fadc1143da9157418f9604cd2dddc7 Mon Sep 17 00:00:00 2001 From: "mats@mysql.com" <> Date: Wed, 15 Mar 2006 11:21:36 +0100 Subject: [PATCH 04/17] 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 | 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 8b2fd13d30543610f977c592a7391fa91e31fe0d Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Wed, 15 Mar 2006 16:29:25 +0100 Subject: [PATCH 05/17] 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 | 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 11979eec94e24cb89708578c5a968a6899b62a4c Mon Sep 17 00:00:00 2001 From: "Reggie@xgeek." <> Date: Wed, 15 Mar 2006 10:22:12 -0600 Subject: [PATCH 06/17] Moved cmake scripts into the proper directories --- .../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 2388e052add8f77bef27b23ce9a6f2d49112dadc Mon Sep 17 00:00:00 2001 From: "Reggie@xgeek." <> Date: Wed, 15 Mar 2006 10:33:16 -0600 Subject: [PATCH 07/17] 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 386ec52a6b21705b5b8fa615f66f722a9338b8b5 Mon Sep 17 00:00:00 2001 From: "konstantin@mysql.com" <> Date: Wed, 15 Mar 2006 20:21:59 +0300 Subject: [PATCH 08/17] 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 | 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 63fb6609daf619ca437cd80a614d1bf9024a86a9 Mon Sep 17 00:00:00 2001 From: "acurtis@xiphis.org" <> Date: Thu, 16 Mar 2006 00:15:23 -0800 Subject: [PATCH 09/17] =?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 | 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 704c0b57e3d18e4b74a9b42585f3304df9012911 Mon Sep 17 00:00:00 2001 From: "mats@mysql.com" <> Date: Thu, 16 Mar 2006 09:23:37 +0100 Subject: [PATCH 10/17] 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 | 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 d75abf873ea1e461fe8cd2f82cd7a512a4c2428f Mon Sep 17 00:00:00 2001 From: "knielsen@mysql.com" <> Date: Thu, 16 Mar 2006 11:21:18 +0100 Subject: [PATCH 11/17] Fix bug in mysql-test-run.pl in ^C signal handler. --- 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 89b10826ced6647006f4cffb71336d2c8276ccf6 Mon Sep 17 00:00:00 2001 From: "mikael@zim.(none)" <> Date: Thu, 16 Mar 2006 03:21:15 -0800 Subject: [PATCH 12/17] BUG#17772 A crash after ALTER TABLE t1 RENAME ... --- 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 23888ae52c5c3ff5ebd672bdcf58c95914154d1e Mon Sep 17 00:00:00 2001 From: "andrey@lmy004." <> Date: Thu, 16 Mar 2006 13:14:40 +0100 Subject: [PATCH 13/17] fix for bug 16408 (Events: crash for an event in a procedure) (one patch) --- 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 24e29bf9d1e81b9780e441c07f1a096b251f611a Mon Sep 17 00:00:00 2001 From: "knielsen@mysql.com" <> Date: Thu, 16 Mar 2006 13:30:59 +0100 Subject: [PATCH 14/17] Fix Windows CMake dependency problem. --- 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 ca4ec2814684c3679daca2530b8e2199e7fb9417 Mon Sep 17 00:00:00 2001 From: "knielsen@mysql.com" <> Date: Thu, 16 Mar 2006 15:42:48 +0100 Subject: [PATCH 15/17] CMake Windows comp_error dependency fix after last push. --- 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 f8ee9e47d5c1bea9cc8e4d9b09e9d3b4e210d564 Mon Sep 17 00:00:00 2001 From: "msvensson@shellback.(none)" <> Date: Thu, 16 Mar 2006 16:03:39 +0100 Subject: [PATCH 16/17] 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 6d7f2ff0f4acf51dbff02e81e582865822c17bd6 Mon Sep 17 00:00:00 2001 From: "knielsen@mysql.com" <> Date: Thu, 16 Mar 2006 16:25:16 +0100 Subject: [PATCH 17/17] 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"