Michael Widenius <[email protected]> writes:

> Kristian> And STRING_WITH_LEN(...) expands to two expressions with a comma 
> between them
> Kristian> UUU, VVV - so I also cannot put DBUG_EVALUATE_IF() around 
> STRING_WITH_LEN().
>
> Kristian> I rewrote it to use strlen() instead of STRING_WITH_LEN - this code 
> is not
> Kristian> performance critical:
>
> I prefer to get rid of strlen() at all.
> Jani has a long going task to go trough the server and remove all
> strlen() adding a strlen() will cause more work for him sooner or
> later...

This is the code:

    const char *q=
      DBUG_EVALUATE_IF("simulate_slave_capability_old_53",
                       "SET @mariadb_slave_capability="
                           STRINGIFY_ARG(MARIA_SLAVE_CAPABILITY_ANNOTATE),
                       "SET @mariadb_slave_capability="
                           STRINGIFY_ARG(MARIA_SLAVE_CAPABILITY_MINE));
    if (mysql_real_query(mysql, q, strlen(q)))

So what do you suggest? Go back to the original code that Serg did not like?

    int rc= DBUG_EVALUATE_IF("simulate_slave_capability_old_53",
        mysql_real_query(mysql, STRING_WITH_LEN("SET @mariadb_slave_capability="
                                
STRINGIFY_ARG(MARIA_SLAVE_CAPABILITY_ANNOTATE))),
        mysql_real_query(mysql, STRING_WITH_LEN("SET @mariadb_slave_capability="
                                STRINGIFY_ARG(MARIA_SLAVE_CAPABILITY_MINE))));
    if (rc)

Or do you have a better idea?

 - Kristian.

_______________________________________________
Mailing list: https://launchpad.net/~maria-developers
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~maria-developers
More help   : https://help.launchpad.net/ListHelp

Reply via email to