← Back to team overview

maria-developers team mailing list archive

Re: Federated code - IRC message

 

Michael Widenius <monty@xxxxxxxxxxxx> writes:

>>>>>> "Patrick" == Patrick Galbraith <patg@xxxxxxxx> writes:
>
> Patrick> Monty,
> Patrick> I saw your message in IRC - I replied in case you don't see it . I want 
> Patrick> to get this into the tree soon and am only having a small problem right now:
>
> Patrick> [08:06]  <CaptTofu> montywi: I am striving to
> Patrick> [08:08]  <CaptTofu> montywi: I just have one issue to solve - if the 
> Patrick> engine is build as a plugin, how I can get the test to run. right now, 
> Patrick> when it runs, it doesn't find the engine loaded, so it skips the test. I 
> Patrick> tried to add a 'load plugin' to the test, but it can find the shared 
> Patrick> library because it expects it to be in "(errno: 2 
> Patrick> dlopen(/Users/patg/code_devel/federated/lib/mysql/plugin/ha_federatedx.so, 
> Patrick> 2): image not found)"

> We should probably try to fix that for the test suite.
> Kristian, do you have any ideas for this ?

The existing test mysql-test/t/plugin.test does something similar to this.

It uses an option file (plugin-master.opt) to set the plugin directory where
mysqld will search for the .so file.

I was able to load a plugin with a test case using INSTALL PLUGIN as follows:

In file mysql-test/t/kn-master.opt:

    --plugin-dir=$MYSQL_TEST_DIR/../storage/example/.libs

In file mysql-test/t/kn.test:

    INSTALL PLUGIN example SONAME 'ha_example.so';

Something similar should work for ha_federatedx.

The tricky thing is to get this to work without failing on Windows (where the
plugin is instead called .dll), and in the case where federatedx is not built
(eg. ./configure option, the plugin will not be found).

For plugin.test, this is solved with some special code in mysql-test-run.pl,
search for EXAMPLE_PLUGIN. It would be easy to add something similar for
federatedx, of course, if not exactly elegant.


I can also think of other possible ways to handle this, let me know if you
need it. Though the Windows case is a bit difficult at present as we have
neither development people nor machines working with Windows at the moment.

> Patrick> So, I'm wondering if to test properly, one needs to compile the engine 
> Patrick> into the server versus as a plugin?
>
> Yes, that is what you need to do (as far as I know).

The above trick with setting the load path in an .opt file should work, though
compiling into the server should work as well, of course.

 - Kristian.



References