Hi,
Maybe it's a good ideea to increase the value of max_allowed_packet(from
my.cnf configuration file) to 2M.By default is 1MB.

Regards,

Gelu
_____________________________________________________
G.NET SOFTWARE COMPANY

Permanent e-mail address : [EMAIL PROTECTED]
                                          [EMAIL PROTECTED]
----- Original Message -----
From: "Daniel Wetzler" <[EMAIL PROTECTED]>
To: "MySQL Mailing Liste" <[EMAIL PROTECTED]>
Sent: Wednesday, January 15, 2003 11:54 AM
Subject: Problem using the C-API for MySQL Program breakdown after about 1
Mio SQL-statements


> Hallo,
>
> I apologize for my bad english.
> Im desperate about the followwing problem :
>
> I'm using the MySQL C-API for accesssing a database with about 1.2 Mio
> SQL-Statemants.
> Therefor I make a connect to the database and after that a loop
> starts a Subprogram about 1.2 Mio times in which a SQL-statement is sent
> to the database. My problem is that the program breaks down after about
> 1 Mio iterations with a Bus error and Segmentation fault.
> If I analyse the core dump with a debugger I get the following statements
:
> The program breaks down at line :
>
> if (mysql_query(mysql2, abfrage)) {
> printf ("Fehler bei der Abfrage ! Fehler : %s \n %s \n",
> mysql_error(mysql2), abfrage);
> exit(1);
>
>
>
> Program terminated with signal 10, Bus Error.
> #0  0xff35a90c in vio_is_blocking () from
> /usr/local/mysql/lib/mysql/libmysqlclient.so.10
> (gdb) up
> #1  0xff35a4e0 in net_clear () from
> /usr/local/mysql/lib/mysql/libmysqlclient.so.10
> (gdb) up
> #2  0xff356abc in simple_command () from
> /usr/local/mysql/lib/mysql/libmysqlclient.so.10
> (gdb) up
> #3  0xff3594e8 in mysql_real_query () from
> /usr/local/mysql/lib/mysql/libmysqlclient.so.10
> (gdb) up
> #4  0x11728 in read_coor (i=1065778) at nclu-datenbank.c:279
> (gdb) up
>
>
> I checked the SQL statement which is sent at that time an it is ok
> and leads to suitable result.
>
>
>
> Does any one have an idea why my program breaks down ?
>
>
> Greetings,
>
>
> Daniel
>
>
>
>
>
>
>
>
> P.S :
>
>
> Here is my code for accessing the database :
>
>
> (some code............. )
>
>   mysql2 = mysql_init(NULL);
>
>      if (mysql2 == NULL){
>        printf ("mysql_init() fehlgeschlagen (kein Speicher ?)\n");
>        exit (1);
>      }
>
>      if (mysql_real_connect( mysql2, def_host_name, def_user_name,
> def_password, def_db_name, 0, NULL, 0) == NULL){
>        printf("Datenbankverbindung hat nicht geklappt.\n");
>      }
>      printf ("Datenbankverbindung 1 ok\n");
>
>
>      while(ergebnisarray[zaehler] != NULL) {
>        /*printf ("zahl = %i\n", ergebnisarray[zaehler]);*/
>
>        j=read_coor(ergebnisarray[zaehler]);
> /* This is my fuction which sends the SQL-statements accessed 1.2 Mio
> times */
>        zaehler++;
>
>      }
>
> mysql_close(mysql2);
>
>
>
> (some code....................)
>
>
>
>
>
> In my function I access the database with the following lines :
>
>
>
>
> (some code)..................
>
>
>    for (seglaengenzaehler = 1; seglaengenzaehler <= seglength;
> seglaengenzaehler ++) {
>
>      sprintf (abfrage, "select xkoor, ykoor, zkoor, id from %iloop inner
> join pdbmolekuel on m%i=molekuelnr inner join pdbatom on molekuelnr =
> molekuelzuordnung where loopnummer = %i", seglength, seglaengenzaehler,
i);
>
>
>        if (mysql_query(mysql2, abfrage)) {
> printf ("Fehler bei der Abfrage ! Fehler : %s \n %s \n",
> mysql_error(mysql2), abfrage);
> exit(1);
>        }
>        else {
> ergebnis = mysql_use_result(mysql2);
>        }
>      }
>
>      if (ergebnis == NULL) {
>        printf ("Fehler beim show tables !\n Fehler : %s ",
> mysql_error(mysql2));
>      }
>      else {
>        /*printf ("Alles in Ordnung !\n");*/
>
>        while((myzeile = mysql_fetch_row(ergebnis)))
> {
>
>   if ( strcmp(myzeile[3],"CA")==0 || strcmp(myzeile[3],"N") == 0 ||
> strcmp(myzeile[3],"C") == 0 ||
>        strcmp(myzeile[3],"O") == 0)
>     {
> // Es werden nur die Atome CA, N, C und O beachtet
>
> coor[j] = atof(myzeile[0]);
> coor[j+1] = atof(myzeile[1]);
> coor[j+2] = atof(myzeile[2]);
> j += 3;
>
>     }
> }
>        mysql_free_result (ergebnis);
>      }
>      resno = j/12;
>    }
>
>
>
> (some code)................
>
>
>
>
>
>
> ---------------------------------------------------------------------
> 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

Reply via email to