Comment 1 for bug 1795314

Revision history for this message
Andreas Hasenack (ahasenack) wrote :

This was fixed upstream, but the fix clashes with Ubuntu's reintroduction of my_bool as a bool.

Ubuntu has:
typedef bool my_bool;

When isc-kea finds my_bool, it does this:
#define HAVE_MYSQL_MY_BOOL
typedef my_bool my_bools;
const my_bool MLM_FALSE = 0;
const my_bool MLM_TRUE = 1;

So now we have my_bools as a bool.

The code later does this (one example, there other places):
    static void setErrorIndicators(std::vector<MYSQL_BIND>& bind,
                                   std::vector<my_bools>& error) {
        for (size_t i = 0; i < error.size(); ++i) {
            error[i] = MLM_FALSE;
#ifdef HAVE_MYSQL_MY_BOOL
            bind[i].error = reinterpret_cast<char*>(&error[i]);
#else
            bind[i].error = reinterpret_cast<bool*>(&error[i]);
#endif

Since HAVE_MYSQL_MY_BOOL was defined (because of Ubuntu's workaround), this is executed:

    bind[i].error = reinterpret_cast<char*>(&error[i]);

And it fails because MYSQL_BIND.error is, in mysql 8, a bool, not a char.