On 04.04.2009 23:03, Sergei Golubchik wrote:
> Yes. This is the current situation and your patch doesn't change it. But
> it changes the perception of it - it makes server internals easier to
> access.
It makes it easier to write and build plugins, yes.
But does simpler build process also mean that it's easier to include a wrong header?
I believe no, it does not.
> If you hack around to access anything else - we know that you can do that -
> you're on your own. No guarantees that it'll work in the next version,
> no support that it'll work at all. Whatever happens - it's all your
> fault."
That's exactly how it looks now, don't you think so?
There is a kind of stable API, but basically I'm on my own, especially if I do
something weird with things I should not touch at all.
> Let's take these problems separately.
> To configure the right way - can you use mysql_config for this ?
No, I can't use mysql_config for this, I need my_config.h and other headers.
Here is why I need them:
mysql_priv.h
------
ha_plugin.cc:26:24: error: mysql_priv.h: No such file or directory
In file included from ha_plugin.cc:27:
/tmp/mysql/include/mysql/my_dir.h:95: error: ‘myf’ has not been declared
/tmp/mysql/include/mysql/my_dir.h:97: error: ‘myf’ has not been declared
/tmp/mysql/include/mysql/my_dir.h:98: error: ‘myf’ has not been declared
------
my_regex.h
------
In file included from /tmp/mysql/include/mysql/item.h:2438,
from /tmp/mysql/include/mysql/mysql_priv.h:751,
from ha_plugin.cc:26:
/tmp/mysql/include/mysql/item_cmpfunc.h:1392:22: error: my_regex.h: No such file or
directory
In file included from /tmp/mysql/include/mysql/item.h:2438,
from /tmp/mysql/include/mysql/mysql_priv.h:751,
from ha_plugin.cc:26:
/tmp/mysql/include/mysql/item_cmpfunc.h:1396: error: ‘my_regex_t’ does not
name a type
------
item.h
------
In file included from ha_plugin.cc:26:
/tmp/mysql/include/mysql/mysql_priv.h:751:18: error: item.h: No such file or directory
In file included from /tmp/mysql/include/mysql/sql_lex.h:40,
from /tmp/mysql/include/mysql/sql_class.h:268,
from /tmp/mysql/include/mysql/mysql_priv.h:847,
from ha_plugin.cc:26
------
I don't really mind if you fix the mentioned headers, so that they would not be required
anymore -
as you might have noticed I don't include them in my code, they're included by other MySQL
headers.
But I'm trying to be realistic and at the moment installing these headers seems to be the
best solution.
I can see at least two other ways:
1) leave it as is, plugin writers and their users deserve to be punished;
2) spend next two years rewriting the headers in order to separate server code from plugin
code, until then - see 1).
Do you prefer any of these or can you think of a better one?
--
Wbr,
Antony Dovgal