Skriniar Gregor writes:
> Hello,
>
> first of all thanks for your comment.
>
> I am sorry that I discussed this problem with Sinisa in private (not via
>[EMAIL PROTECTED]). So, once more I would like to summarize it:
> My opinion is that there is/(at least) was a bug in your API because:
> > *mysql=tmp_mysql; //especialy this is the point. You assign value of
>tmp_mysql into *mysql. But MYSQL is defined as structure, which contains several
>pointers and is evident, that after return from this function the pointers are
>corrupted. I would expect dynamicaly allocated tmp_mysql and assign in this manner
>obtained pointer to mysql. Something like:
> >
> > MYSQL *tmp_mysql;
> > tmp_mysql = (MYSQL *) my_alloc(...);
> > ....
> > mysql=tmp_mysql;
>
> After this email I received new body of the method (mysql_reconnect()) from Sinisa:
> ...
> *mysql=tmp_mysql;
> mysql_fix_pointers(mysql, &tmp_mysql); /* adjust connection pointers */
> ...
> this method contains (unlike version known to me) function call
>mysql_fix_pointers(), which probably handles pointers of MYSQL struct. Am I right? I
>would like to know the body of this new method to be sure. Also, I would like to
>know, which version comes this method with? Because I could not find it in
>http://www.mysql.com/downloads/mysql-3.23.html. Maybe version 4.0.0 and later?
>
> Regards
> Gregor
>
Hi!
This is what the above function does :
static void mysql_fix_pointers(MYSQL* mysql, MYSQL* old_mysql)
{
MYSQL *tmp, *tmp_prev;
if (mysql->master == old_mysql)
mysql->master = mysql;
if (mysql->last_used_con == old_mysql)
mysql->last_used_con = mysql;
if (mysql->last_used_slave == old_mysql)
mysql->last_used_slave = mysql;
for (tmp_prev = mysql, tmp = mysql->next_slave;
tmp != old_mysql;tmp = tmp->next_slave)
{
tmp_prev = tmp;
}
tmp_prev->next_slave = mysql;
}
It was added in 3.23 tree, I think in 3.23.33, but I am not sure.
I am definitely sure that it was not added in 4.0 tree, but in 3.23
tree.
--
Regards,
__ ___ ___ ____ __
/ |/ /_ __/ __/ __ \/ / Mr. Sinisa Milivojevic <[EMAIL PROTECTED]>
/ /|_/ / // /\ \/ /_/ / /__ MySQL AB, Fulltime Developer
/_/ /_/\_, /___/\___\_\___/ Larnaca, Cyprus
<___/ www.mysql.com
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php
---------------------------------------------------------------------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)
To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php