List:General Discussion« Previous MessageNext Message »
From:terry jones Date:April 12 1999 5:15am
Subject:Re: Opening multiple MySQL connections in one program (with and
without threads).
View as plain text  
Hi Ilya.

Here's a summary. There were 3 suggestions:

 1) Update to redhat 5.2
 2) Configure using --enable-thread-safe-client
 3) Let mysql_init allocate the MYSQL structs

With 1 and 2 done, I got no improvement. When I also did 3, everything
worked. The patching was to my own code, not to any code in MySQL.
Two people reported that my code ran just fine on their machines.

The change (number 3 above) suggested by Monty was to replace this


    MYSQL *mysql = (MYSQL *) malloc(sizeof(MYSQL));
    if (!mysql)
        /* error */
    mysql_init(mysql);


with this


    MYSQL *mysql = mysql_init((MYSQL *) 0);    
    if (!mysql)
        /* error */


This finally made my test program run correctly. If you want a copy of
it. mail me and I'll send it to you.


Terry.
Thread
Opening multiple MySQL connections in one program (with and without threads).terry jones12 Apr
  • Re: Opening multiple MySQL connections in one program (with and without threads).Ed Carp12 Apr
  • Re: Opening multiple MySQL connections in one program (with and without threads).terry jones12 Apr
  • Re: Opening multiple MySQL connections in one program (with and without threads).Ed Carp12 Apr
  • Re: Opening multiple MySQL connections in one program (with and without threads).Ed Carp12 Apr
  • Re: Opening multiple MySQL connections in one program (with andwithout threads).Aldrian Gintingsuka12 Apr
  • Opening multiple MySQL connections in one program (with and without threads).Michael Widenius12 Apr
  • Opening multiple MySQL connections in one program (with and without threads).terry jones12 Apr
    • Re: Opening multiple MySQL connections in one program (with andwithout threads).Ilya Obshadko12 Apr
    • Re: Opening multiple MySQL connections in one program (with andwithout threads).terry jones12 Apr
      • Re: Opening multiple MySQL connections in one program (with andwithout threads).Ilya Obshadko12 Apr
      • Re: Opening multiple MySQL connections in one program (with andwithout threads).terry jones13 Apr
  • Re: Opening multiple MySQL connections in one program (with and without threads).Ed Carp13 Apr
  • Re: Opening multiple MySQL connections in one program (with and without threads).terry jones14 Apr