List:Commits« Previous MessageNext Message »
From:Ingo Struewing Date:April 1 2008 9:42pm
Subject:bk commit into 5.1 tree (istruewing:1.2576)
View as plain text  
Below is the list of changes that have just been committed into a local
5.1 repository of istruewing.  When istruewing does a push these changes
will be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2008-04-01 21:42:51+02:00, istruewing@stripped +32 -0
  Dynamic Federated Plugin
  
  The Federated storage engine shall not be available in a server
  unless explicitly loaded with INSTALL PLUGIN federated.
  
  Removed the static build of the Federated plugin.
  
  Changed mysql-test-run.pl to support dynamic loading of the
  Federated plugin.
  
  Changed the federated test cases to do dynamic loading and
  and unloading of the Federated plugin.
  
  Changed use of dynstr_append_mem() to handcrafted string
  handling. dynstr_append_mem() was not available in the server
  and could not be loaded dynamically.
  
  Suppressed binlogging when inserting a loaded plugin to the
  plugin table. This prevents row based replication to install
  plugins on the slave. We do no statement based replication of
  INSTALL PLUGIN.

  mysql-test/include/federated.inc@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +11 -0
    Dynamic Federated Plugin
    Added code for dynamc loading of Federated.

  mysql-test/include/federated_cleanup.inc@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +7 -0
    Dynamic Federated Plugin
    Added code for dynamc un-loading of Federated.

  mysql-test/include/have_federated_db.inc@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +10 -1
    Dynamic Federated Plugin
    Added/changed code for dynamc loading of Federated.

  mysql-test/mysql-test-run.pl@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +14 -0
    Dynamic Federated Plugin
    Added code to support dynamc loading of Federated.

  mysql-test/r/federated.result@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +10 -0
    Dynamic Federated Plugin
    Fixed test result.

  mysql-test/r/federated_archive.result@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +10 -0
    Dynamic Federated Plugin
    Fixed test result.

  mysql-test/r/federated_bug_13118.result@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +10 -0
    Dynamic Federated Plugin
    Fixed test result.

  mysql-test/r/federated_bug_25714.result@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +10 -0
    Dynamic Federated Plugin
    Fixed test result.

  mysql-test/r/federated_innodb.result@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +10 -0
    Dynamic Federated Plugin
    Fixed test result.

  mysql-test/r/federated_server.result@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +10 -0
    Dynamic Federated Plugin
    Fixed test result.

  mysql-test/r/partition_federated.result@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +2 -0
    Dynamic Federated Plugin
    Fixed test result.

  mysql-test/t/federated-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/federated-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/federated-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/federated-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/federated_archive-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/federated_archive-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/federated_archive-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/federated_archive-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/federated_bug_13118-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/federated_bug_13118-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/federated_bug_13118-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/federated_bug_13118-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/federated_bug_25714-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/federated_bug_25714-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/federated_bug_25714-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/federated_bug_25714-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/federated_innodb-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/federated_innodb-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/federated_innodb-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/federated_server-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/federated_server-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/federated_server-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/federated_server-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/federated_transactions-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/federated_transactions-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/federated_transactions-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/partition_federated-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/partition_federated-master.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/partition_federated-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +1 -0
    Dynamic Federated Plugin
    Added --plugin_dir option.

  mysql-test/t/partition_federated-slave.opt@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -0

  mysql-test/t/partition_federated.test@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +5 -0
    Dynamic Federated Plugin
    Added code for dynamc loading of Federated.

  sql/sql_plugin.cc@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +9 -0
    Dynamic Federated Plugin
    Suppressed binlogging when inserting a loaded plugin to the
    plugin table.

  storage/federated/ha_federated.cc@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +45 -24
    Dynamic Federated Plugin
    Changed use of dynstr_append_mem() to handcrafted string
    handling. dynstr_append_mem() was not available in the server
    and could not be loaded dynamically.

  storage/federated/ha_federated.h@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +8 -1
    Dynamic Federated Plugin
    Changed use of dynstr_append_mem() to handcrafted string
    handling. dynstr_append_mem() was not available in the server
    and could not be loaded dynamically.

  storage/federated/plug.in@stripped, 2008-04-01 21:42:45+02:00, istruewing@stripped +0 -1
    Dynamic Federated Plugin
    Removed static build of the Federated plugin.

diff -Nrup a/mysql-test/include/federated.inc b/mysql-test/include/federated.inc
--- a/mysql-test/include/federated.inc	2007-05-15 11:33:16 +02:00
+++ b/mysql-test/include/federated.inc	2008-04-01 21:42:45 +02:00
@@ -4,6 +4,17 @@
 
 source ./include/master-slave.inc;
 
+echo connection master;
+connection master;
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
+#
+    echo connection slave;
+    connection slave;
+    INSTALL PLUGIN federated SONAME 'ha_federated.so';
+#
+echo connection master;
+connection master;
+
 # remote table creation
 
 # We have to sync with master, to ensure slave had time to start properly
diff -Nrup a/mysql-test/include/federated_cleanup.inc b/mysql-test/include/federated_cleanup.inc
--- a/mysql-test/include/federated_cleanup.inc	2007-04-17 13:41:14 +02:00
+++ b/mysql-test/include/federated_cleanup.inc	2008-04-01 21:42:45 +02:00
@@ -1,9 +1,16 @@
+echo connection master;
 connection master;
 --disable_warnings
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
 
+echo connection slave;
 connection slave;
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
+
+echo connection default;
+connection default;
 --enable_warnings
diff -Nrup a/mysql-test/include/have_federated_db.inc b/mysql-test/include/have_federated_db.inc
--- a/mysql-test/include/have_federated_db.inc	2007-06-09 13:05:41 +02:00
+++ b/mysql-test/include/have_federated_db.inc	2008-04-01 21:42:45 +02:00
@@ -1,4 +1,13 @@
+#
+# Check if server has support for loading udf's
+# i.e it will support dlopen
+#
+--require r/have_dynamic_loading.require
 disable_query_log;
+show variables like "have_dynamic_loading";
+enable_query_log;
+
 --require r/true.require
-select (support = 'YES' or support = 'DEFAULT') as `TRUE` from information_schema.engines where engine = 'federated';
+disable_query_log;
+select LENGTH("$FEDERATED_PLUGIN") > 0 as `TRUE`;
 enable_query_log;
diff -Nrup a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl
--- a/mysql-test/mysql-test-run.pl	2008-02-22 19:15:26 +01:00
+++ b/mysql-test/mysql-test-run.pl	2008-04-01 21:42:45 +02:00
@@ -172,6 +172,7 @@ our $exe_my_print_defaults;
 our $exe_perror;
 our $lib_udf_example;
 our $lib_example_plugin;
+our $lib_federated_plugin;
 our $exe_libtool;
 
 our $opt_bench= 0;
@@ -1700,6 +1701,11 @@ sub executable_setup () {
       mtr_file_exists(vs_config_dirs('storage/example', 'ha_example.dll'),
                       "$glob_basedir/storage/example/.libs/ha_example.so",);
 
+    # Look for the ha_federated library
+    $lib_federated_plugin=
+      mtr_file_exists(vs_config_dirs('storage/federated', 'ha_federated.dll'),
+                      "$glob_basedir/storage/federated/.libs/ha_federated.so",);
+
   }
 
   # Look for mysqltest executable
@@ -2171,6 +2177,14 @@ sub environment_setup () {
     ($lib_example_plugin ? basename($lib_example_plugin) : "");
   $ENV{'EXAMPLE_PLUGIN_OPT'}=
     ($lib_example_plugin ? "--plugin_dir=" . dirname($lib_example_plugin) : "");
+
+  # ----------------------------------------------------
+  # Add the path where mysqld will find ha_federated.so
+  # ----------------------------------------------------
+  $ENV{'FEDERATED_PLUGIN'}=
+    ($lib_federated_plugin ? basename($lib_federated_plugin) : "");
+  $ENV{'FEDERATED_PLUGIN_OPT'}=
+    ($lib_federated_plugin ? "--plugin_dir=" . dirname($lib_federated_plugin) : "");
 
   # ----------------------------------------------------
   # Setup env so childs can execute myisampack and myisamchk
diff -Nrup a/mysql-test/r/federated.result b/mysql-test/r/federated.result
--- a/mysql-test/r/federated.result	2008-03-25 14:37:51 +01:00
+++ b/mysql-test/r/federated.result	2008-04-01 21:42:45 +02:00
@@ -4,6 +4,11 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+connection master
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
+connection slave
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
+connection master
 stop slave;
 DROP DATABASE IF EXISTS federated;
 CREATE DATABASE federated;
@@ -2095,7 +2100,12 @@ DROP TABLE t1;
 create server 's1' foreign data wrapper 'mysql' options (port 3306);
 drop server 's1';
 End of 5.1 tests
+connection master
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
+connection slave
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
+connection default
diff -Nrup a/mysql-test/r/federated_archive.result b/mysql-test/r/federated_archive.result
--- a/mysql-test/r/federated_archive.result	2006-05-12 18:58:43 +02:00
+++ b/mysql-test/r/federated_archive.result	2008-04-01 21:42:45 +02:00
@@ -4,6 +4,11 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+connection master
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
+connection slave
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
+connection master
 stop slave;
 DROP DATABASE IF EXISTS federated;
 CREATE DATABASE federated;
@@ -42,7 +47,12 @@ id	name
 2	bar
 DROP TABLE federated.t1;
 DROP TABLE federated.archive_table;
+connection master
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
+connection slave
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
+connection default
diff -Nrup a/mysql-test/r/federated_bug_13118.result b/mysql-test/r/federated_bug_13118.result
--- a/mysql-test/r/federated_bug_13118.result	2006-05-12 18:58:43 +02:00
+++ b/mysql-test/r/federated_bug_13118.result	2008-04-01 21:42:45 +02:00
@@ -4,6 +4,11 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+connection master
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
+connection slave
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
+connection master
 stop slave;
 DROP DATABASE IF EXISTS federated;
 CREATE DATABASE federated;
@@ -33,7 +38,12 @@ foo	bar
 1	1
 DROP TABLE federated.t1;
 DROP TABLE federated.bug_13118_table;
+connection master
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
+connection slave
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
+connection default
diff -Nrup a/mysql-test/r/federated_bug_25714.result b/mysql-test/r/federated_bug_25714.result
--- a/mysql-test/r/federated_bug_25714.result	2007-07-24 08:35:40 +02:00
+++ b/mysql-test/r/federated_bug_25714.result	2008-04-01 21:42:45 +02:00
@@ -4,6 +4,11 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+connection master
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
+connection slave
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
+connection master
 stop slave;
 DROP DATABASE IF EXISTS federated;
 CREATE DATABASE federated;
@@ -50,7 +55,12 @@ id	value
 8	55
 DROP TABLE federated.t1;
 DROP TABLE federated.t1;
+connection master
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
+connection slave
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
+connection default
diff -Nrup a/mysql-test/r/federated_innodb.result b/mysql-test/r/federated_innodb.result
--- a/mysql-test/r/federated_innodb.result	2007-06-29 01:02:58 +02:00
+++ b/mysql-test/r/federated_innodb.result	2008-04-01 21:42:45 +02:00
@@ -4,6 +4,11 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+connection master
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
+connection slave
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
+connection master
 stop slave;
 DROP DATABASE IF EXISTS federated;
 CREATE DATABASE federated;
@@ -28,7 +33,12 @@ select * from federated.t1;
 a	b
 drop table federated.t1;
 drop table federated.t1;
+connection master
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
+connection slave
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
+connection default
diff -Nrup a/mysql-test/r/federated_server.result b/mysql-test/r/federated_server.result
--- a/mysql-test/r/federated_server.result	2007-11-01 20:29:59 +01:00
+++ b/mysql-test/r/federated_server.result	2008-04-01 21:42:45 +02:00
@@ -4,6 +4,11 @@ reset master;
 reset slave;
 drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
 start slave;
+connection master
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
+connection slave
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
+connection master
 stop slave;
 DROP DATABASE IF EXISTS federated;
 CREATE DATABASE federated;
@@ -289,7 +294,12 @@ e > 0
 1
 drop procedure p1;
 drop server if exists s;
+connection master
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
+connection slave
 DROP TABLE IF EXISTS federated.t1;
 DROP DATABASE IF EXISTS federated;
+UNINSTALL PLUGIN federated;
+connection default
diff -Nrup a/mysql-test/r/partition_federated.result b/mysql-test/r/partition_federated.result
--- a/mysql-test/r/partition_federated.result	2006-12-19 13:37:45 +01:00
+++ b/mysql-test/r/partition_federated.result	2008-04-01 21:42:45 +02:00
@@ -1,6 +1,8 @@
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
 drop table if exists t1;
 create table t1 (s1 int) engine=federated
 connection='mysql://root@localhost/federated/t1' partition by list (s1)
 (partition p1 values in (1), partition p2 values in (2));
 ERROR HY000: Engine cannot be used in partitioned tables
 End of 5.1 tests
+UNINSTALL PLUGIN federated;
diff -Nrup a/mysql-test/t/federated-master.opt b/mysql-test/t/federated-master.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/federated-master.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/federated-slave.opt b/mysql-test/t/federated-slave.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/federated-slave.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/federated_archive-master.opt b/mysql-test/t/federated_archive-master.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/federated_archive-master.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/federated_archive-slave.opt b/mysql-test/t/federated_archive-slave.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/federated_archive-slave.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/federated_bug_13118-master.opt b/mysql-test/t/federated_bug_13118-master.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/federated_bug_13118-master.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/federated_bug_13118-slave.opt b/mysql-test/t/federated_bug_13118-slave.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/federated_bug_13118-slave.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/federated_bug_25714-master.opt b/mysql-test/t/federated_bug_25714-master.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/federated_bug_25714-master.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/federated_bug_25714-slave.opt b/mysql-test/t/federated_bug_25714-slave.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/federated_bug_25714-slave.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/federated_innodb-master.opt b/mysql-test/t/federated_innodb-master.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/federated_innodb-master.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/federated_innodb-slave.opt b/mysql-test/t/federated_innodb-slave.opt
--- a/mysql-test/t/federated_innodb-slave.opt	2007-06-29 01:02:58 +02:00
+++ b/mysql-test/t/federated_innodb-slave.opt	2008-04-01 21:42:45 +02:00
@@ -1 +1,2 @@
+$FEDERATED_PLUGIN_OPT
 --innodb
diff -Nrup a/mysql-test/t/federated_server-master.opt b/mysql-test/t/federated_server-master.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/federated_server-master.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/federated_server-slave.opt b/mysql-test/t/federated_server-slave.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/federated_server-slave.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/federated_transactions-master.opt b/mysql-test/t/federated_transactions-master.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/federated_transactions-master.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/federated_transactions-slave.opt b/mysql-test/t/federated_transactions-slave.opt
--- a/mysql-test/t/federated_transactions-slave.opt	2007-05-04 16:10:05 +02:00
+++ b/mysql-test/t/federated_transactions-slave.opt	2008-04-01 21:42:45 +02:00
@@ -1 +1,2 @@
+$FEDERATED_PLUGIN_OPT
 --loose-innodb
diff -Nrup a/mysql-test/t/partition_federated-master.opt b/mysql-test/t/partition_federated-master.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/partition_federated-master.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/partition_federated-slave.opt b/mysql-test/t/partition_federated-slave.opt
--- /dev/null	Wed Dec 31 16:00:00 196900
+++ b/mysql-test/t/partition_federated-slave.opt	2008-04-01 21:42:45 +02:00
@@ -0,0 +1 @@
+$FEDERATED_PLUGIN_OPT
diff -Nrup a/mysql-test/t/partition_federated.test b/mysql-test/t/partition_federated.test
--- a/mysql-test/t/partition_federated.test	2006-12-19 13:37:45 +01:00
+++ b/mysql-test/t/partition_federated.test	2008-04-01 21:42:45 +02:00
@@ -4,6 +4,7 @@
 -- source include/have_partition.inc
 -- source include/not_embedded.inc
 -- source include/have_federated_db.inc
+INSTALL PLUGIN federated SONAME 'ha_federated.so';
 
 --disable_warnings
 drop table if exists t1;
@@ -19,3 +20,7 @@ connection='mysql://root@localhost/feder
 (partition p1 values in (1), partition p2 values in (2));
 
 --echo End of 5.1 tests
+
+--disable_warnings
+UNINSTALL PLUGIN federated;
+--enable_warnings
diff -Nrup a/sql/sql_plugin.cc b/sql/sql_plugin.cc
--- a/sql/sql_plugin.cc	2008-03-14 18:50:33 +01:00
+++ b/sql/sql_plugin.cc	2008-04-01 21:42:45 +02:00
@@ -342,6 +342,7 @@ static st_plugin_dl *plugin_dl_add(const
   struct st_plugin_dl *tmp, plugin_dl;
   void *sym;
   DBUG_ENTER("plugin_dl_add");
+  DBUG_PRINT("plugin", ("loading: '%.*s'", dl->length, dl->str));
   plugin_dir_len= strlen(opt_plugin_dir);
   /*
     Ensure that the dll doesn't have a path.
@@ -1410,6 +1411,7 @@ static bool plugin_load_list(MEM_ROOT *t
   struct st_mysql_plugin *plugin;
   char *p= buffer;
   DBUG_ENTER("plugin_load_list");
+  DBUG_PRINT("plugin", ("loading list: '%s'", list));
   while (list)
   {
     if (p == buffer + sizeof(buffer) - 1)
@@ -1666,11 +1668,18 @@ bool mysql_install_plugin(THD *thd, cons
     goto deinit;
   }
 
+  /*
+    We do not replicate the INSTALL PLUGIN statement. Disable binlogging
+    of the insert into the plugin table, so that it is not replicated in
+    row based mode.
+  */
+  tmp_disable_binlog(thd);
   table->use_all_columns();
   restore_record(table, s->default_values);
   table->field[0]->store(name->str, name->length, system_charset_info);
   table->field[1]->store(dl->str, dl->length, files_charset_info);
   error= table->file->ha_write_row(table->record[0]);
+  reenable_binlog(thd);
   if (error)
   {
     table->file->print_error(error, MYF(0));
diff -Nrup a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc
--- a/storage/federated/ha_federated.cc	2008-03-25 17:28:36 +01:00
+++ b/storage/federated/ha_federated.cc	2008-04-01 21:42:45 +02:00
@@ -875,7 +875,9 @@ ha_federated::ha_federated(handlerton *h
   mysql(0), stored_result(0)
 {
   trx_next= 0;
-  bzero(&bulk_insert, sizeof(bulk_insert));
+  bulk_insert.str= NULL;
+  bulk_insert.allocated= 0;
+  bulk_insert.length= 0;
 }
 
 
@@ -1877,6 +1879,12 @@ int ha_federated::write_row(uchar *buf)
 
   if (use_bulk_insert)
   {
+    char *ptr;
+    char insert_buffer[FEDERATED_QUERY_BUFFER_SIZE];
+    String insert_string(insert_buffer, sizeof(insert_buffer),
+                         &my_charset_bin);
+    uint length;
+
     /*
       Send the current bulk insert out if appending the current row would
       cause the statement to overflow the packet size, otherwise set
@@ -1890,23 +1898,34 @@ int ha_federated::write_row(uchar *buf)
     }
     else
       auto_increment_update_required= FALSE;
-      
+
+    insert_string.length(0);
     if (bulk_insert.length == 0)
-    {
-      char insert_buffer[FEDERATED_QUERY_BUFFER_SIZE];
-      String insert_string(insert_buffer, sizeof(insert_buffer), 
-                           &my_charset_bin);
-      insert_string.length(0);
       append_stmt_insert(&insert_string);
-      dynstr_append_mem(&bulk_insert, insert_string.ptr(), 
-                        insert_string.length());
-    }
     else
-      dynstr_append_mem(&bulk_insert, ",", 1);
+      insert_string.append(",", 1);
 
-    dynstr_append_mem(&bulk_insert, values_string.ptr(), 
-                      values_string.length());
-  }  
+    length= (bulk_insert.length + insert_string.length() +
+             values_string.length());
+    if (length >= bulk_insert.allocated)
+    {
+      length= MY_ALIGN(length, IO_SIZE);
+      ptr= (char*) my_realloc(bulk_insert.str, length,
+                              MYF(MY_WME | MY_ALLOW_ZERO_PTR));
+      if (!ptr)
+        DBUG_RETURN(my_errno);
+      bulk_insert.str= ptr;
+      bulk_insert.allocated= length;
+    }
+    ptr= bulk_insert.str + bulk_insert.length;
+
+    memcpy(ptr, insert_string.ptr(), insert_string.length());
+    ptr+= insert_string.length();
+
+    memcpy(ptr, values_string.ptr(), values_string.length());
+    ptr+= values_string.length();
+    bulk_insert.length= ptr - bulk_insert.str;
+  }
   else
   {
     error= real_query(values_string.ptr(), values_string.length());
@@ -1943,11 +1962,13 @@ int ha_federated::write_row(uchar *buf)
 
 void ha_federated::start_bulk_insert(ha_rows rows)
 {
-  uint page_size;
   DBUG_ENTER("ha_federated::start_bulk_insert");
 
-  dynstr_free(&bulk_insert);
-  
+  my_free(bulk_insert.str, MYF(MY_ALLOW_ZERO_PTR));
+  bulk_insert.str= NULL;
+  bulk_insert.allocated= 0;
+  bulk_insert.length= 0;
+
   /**
     We don't bother with bulk-insert semantics when the estimated rows == 1
     The rows value will be 0 if the server does not know how many rows
@@ -1964,12 +1985,9 @@ void ha_federated::start_bulk_insert(ha_
   if (!mysql && real_connect())
     DBUG_VOID_RETURN;
 
-  page_size= (uint) my_getpagesize();
+  bulk_insert.str= (char*) my_malloc(IO_SIZE, MYF(MY_WME));
+  bulk_insert.allocated= bulk_insert.str ? IO_SIZE : 0;
 
-  if (init_dynamic_string(&bulk_insert, NULL, page_size, page_size))
-    DBUG_VOID_RETURN;
-  
-  bulk_insert.length= 0;
   DBUG_VOID_RETURN;
 }
 
@@ -1999,8 +2017,11 @@ int ha_federated::end_bulk_insert()
       update_auto_increment();
   }
 
-  dynstr_free(&bulk_insert);
-  
+  my_free(bulk_insert.str, MYF(MY_ALLOW_ZERO_PTR));
+  bulk_insert.str= NULL;
+  bulk_insert.allocated= 0;
+  bulk_insert.length= 0;
+
   DBUG_RETURN(my_errno= error);
 }
 
diff -Nrup a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h
--- a/storage/federated/ha_federated.h	2007-11-30 21:46:38 +01:00
+++ b/storage/federated/ha_federated.h	2008-04-01 21:42:45 +02:00
@@ -38,6 +38,13 @@
 #define FEDERATED_RECORDS_IN_RANGE 2
 #define FEDERATED_MAX_KEY_LENGTH 3500 // Same as innodb
 
+struct st_istring
+{
+  char  *str;
+  uint  allocated;
+  uint  length;
+};
+
 /*
   FEDERATED_SHARE is a structure that will be shared amoung all open handlers
   The example implements the minimum of what you will probably need.
@@ -90,7 +97,7 @@ class ha_federated: public handler
   char remote_error_buf[FEDERATED_QUERY_BUFFER_SIZE];
   bool ignore_duplicates, replace_duplicates;
   bool insert_dup_update;
-  DYNAMIC_STRING bulk_insert;
+  st_istring bulk_insert;
 
 private:
   /*
diff -Nrup a/storage/federated/plug.in b/storage/federated/plug.in
--- a/storage/federated/plug.in	2006-10-18 14:03:30 +02:00
+++ b/storage/federated/plug.in	2008-04-01 21:42:45 +02:00
@@ -1,5 +1,4 @@
 MYSQL_STORAGE_ENGINE(federated,,[Federated Storage Engine],
         [Connects to tables on remote MySQL servers], [max,max-no-ndb])
-MYSQL_PLUGIN_STATIC(federated,    [libfederated.a])
 MYSQL_PLUGIN_DYNAMIC(federated,   [ha_federated.la])
 MYSQL_PLUGIN_DEPENDS_ON_MYSQL_INTERNALS(federated, [ha_federated.cc])
Thread
bk commit into 5.1 tree (istruewing:1.2576)Ingo Struewing1 Apr
  • RE: bk commit into 5.1 tree (istruewing:1.2576)Chuck Bell2 Apr
    • Re: bk commit into 5.1 tree (istruewing:1.2576)Ingo Strüwing2 Apr