← Back to team overview

maria-developers team mailing list archive

Re: bzr commit into MariaDB 5.1, with Maria 1.5:maria branch (monty:2770)

 

Hi!

>>>>> "Sergei" == Sergei Golubchik <sergii@xxxxxxxxx> writes:

Sergei> Hi, Michael!
Sergei> On Nov 29, Michael Widenius wrote:
>> 2770 Michael Widenius	2009-11-30
>> Change type for functions in plugin.h:str_mysql_ftparser_param()
>> to const unsigned char and string lengths to size_t.

Sergei> You cannot do it that way.
Sergei> char -> const unsigned char is fine, but
Sergei> int -> size_t is not, because they may have different width and on this
Sergei> system your change breaks the ABI.

Sergei> The best solution would be to undo your change and to keep internal
Sergei> MariaDB problems (like gcc warnins in the MariaDB code) strictly
Sergei> internal and not reflected in the API. But if you absolutely must to
Sergei> change it - you have to increase the API version. It's an incompatible
Sergei> change, you have to set it to 0x0200 thus making all existent ftparser
Sergei> plugins invalid. And this will fork the API - when Sun/MySQL will change
Sergei> the API and set the version to 0x0200, there will be two different
Sergei> incompatible APIs both having 0x0200 version.

Sergei> So, again, the best solution is to keep the int type.

As discussed on IRC:
- Changed the type back to int, but did it with a typedef so that we
  can at next ABI change just change the typedef and no other code
  change is necessary.

This will also make it easier for other storage engines to prepare for
the type change.

Regards,
Monty





References