mysql C API hang

mysql C API hang

am 03.04.2005 15:03:11 von Karl

Hello,
sry about my bad english.

in code is something this:
sprintf(query,"update database.table set something='something else' where
username='someone'");
mysql_query(&mysql,query);

and it works. This program runs long time (always connected to mysql) and
after 6-7 days same query hang it.

(gdb) bt
#0 0x40128f14 in __libc_read () from /lib/libc.so.6
#1 0x40069554 in _no_db_ () from /usr/lib/libmysqlclient.so.10
#2 0x40058895 in net_real_write () from /usr/lib/libmysqlclient.so.10
#3 0x40058ab6 in my_net_read () from /usr/lib/libmysqlclient.so.10
#4 0x40054d27 in _init () from /usr/lib/libmysqlclient.so.10
#5 0x40056d0d in mysql_read_query_result () from
/usr/lib/libmysqlclient.so.10
#6 0x40057cba in mysql_real_query () from /usr/lib/libmysqlclient.so.10
#7 0x40057c49 in mysql_query () from /usr/lib/libmysqlclient.so.10
#8 0x80578a9 in save_user_details (user=0x81517b8, save_current=1) at
myprogram.c:3482

any ideas?


Karl
karl@infotek.ee


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: mysql C API hang

am 03.04.2005 18:14:55 von oceanare pte ltd

Hi,

Karl wrote:
> Hello,
> sry about my bad english.
>
> in code is something this:
> sprintf(query,"update database.table set something='something else' where
> username='someone'");
> mysql_query(&mysql,query);
>
Could it be a memory problem?

WHat do you do with the connection after each update?

Where is 'query' stored? At the stack or the heap?

Erich

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: mysql C API hang

am 03.04.2005 20:57:41 von Karl

Hello,

> > sry about my bad english.
> >
> > in code is something this:
> > sprintf(query,"update database.table set something='something else'
where
> > username='someone'");
> > mysql_query(&mysql,query);
> >
> Could it be a memory problem?
how can i test it?

> WHat do you do with the connection after each update?
mysql is always connected

> Where is 'query' stored? At the stack or the heap?
char query [2048];
shoult be long enough.


Karl


--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org

Re: mysql C API hang

am 04.04.2005 04:28:28 von oceanare pte ltd

Hi,

Karl wrote:

>>>sprintf(query,"update database.table set something='something else'
>
> where
>
>>>username='someone'");
>>>mysql_query(&mysql,query);
>>>
>>
>>Could it be a memory problem?
>
> how can i test it?
>
Write all queries to a log file and / or print the length of each query
if longer than 1KB to the screen or another log file.
>
>>WHat do you do with the connection after each update?
>
> mysql is always connected
>
I never left a connection open this long.
>
>>Where is 'query' stored? At the stack or the heap?
>
> char query [2048];
> shoult be long enough.
>
Should and is are two different things if you do not check the length of
the input data.

Erich

--
MySQL Bugs Mailing List
For list archives: http://lists.mysql.com/bugs
To unsubscribe: http://lists.mysql.com/bugs?unsub=gcdmb-bugs@m.gmane.org