Handler and flush tables with read lock

2006-05-17 Thread ianc

Hi,

If you "open" a table using,

HANDLER tablename OPEN;

and then (in another MySQL command windows), execute,

flush tables with read lock;

The flush tables "hangs" until you execute a

HANDLER tablename CLOSE;

command.

Is this a bug? Can anyone explain this?

Many Regards,
Ian Collins.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



Linking libmysqlclient.a into shared libraries on HPUX 11.00

2006-05-19 Thread ianc

Hi,
This is driving me crazy. When we were using MySQL 4.0.x we could create 
a shared library with libmysqlclient.a bound in.

With MySQL 4.1 onwards, we get the error,

/usr/ccs/bin/ld: Invalid loader fixup in text space needed in output 
file for symbol "$003A" in input file 
"/usr/local/mysql5/lib/libmysqlclient.a(client.o)"


Operating system: HPUX 11.00 (yes, I have to keep it going to support 
some customers who won't upgrade!)

Compiler: HPUX C

This is really easily reproduced with a 7 line program...

test.c
/* === snip === */
#include 
#include 

#include 

void testfunc() {
 static MYSQL* conn;
 conn= mysql_init(NULL);
}
/* === snip === */

On MySQL 4.0.x, you can create the shared library libtest.sl using,

cc -I/usr/local/mysql4/include -o libtest.sl -b -Aa +e +DAportable 
-Wl,+s -notrigraph test.c -L/usr/local/mysql4/lib -lmysqlclient -lcrypt 
-lnsl -lm


That works fine.

However on 4.1 and later versions of MySQL, the command (-lz needs to be 
added for these versions) gives,


cc -I/usr/local/mysql5/include -o libtest.sl -b -Aa +e +DAportable 
-Wl,+s -notrigraph test.c -L/usr/local/mysql5/lib -lmysqlclient -lz 
-lcrypt -lnsl -lm
/usr/ccs/bin/ld: Invalid loader fixup in text space needed in output 
file for symbol "$003A" in input file 
"/usr/local/mysql5/lib/libmysqlclient.a(client.o)"


Help!

Regards,
Ian Collins.


--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



help: I need to check if a connection_id is still alive (for advisory locking system).

2002-03-29 Thread ianc

I am trying to implement a simple advisory locking system for my application.
It is trying to mimic the functionality of a legacy inhouse database 
application, and the mysql GET_LOCK or LOCK TABLE does not seem sufficient 
for our purposes, as our application requires tables to be locked/unlocked, 
and for multiple locks to be active at any time.
(The GET_LOCK unlocks any previous locks before locking any new ones, which 
really screws with our code :-)  ).

Anyway,
My locking table will have the following format (or similiar),

CREATE TABLE mylocks
(
   lockname char(20)   not null,
   pid   intnot null,
   statusintnot null,
   PRIMARY KEY (lockname)
);

When our application needs to "lock" a table, it will populate a row with the 
status set to "1" and the pid set to the thread connection id.

When our application sees that a lockname is "locked", it needs to also 
verify that the connection id is still valid. (i.e. that the process did not 
crash with "locks" active). 

This is the bit that has stumped me.

I originally was just going to do a "show processlist", but I've just read in 
the manual that this does not necessarily show all processes (depending on 
the current users grant table).

My questions:
1. Is there any way to check the "pid" (connection id) to see if it is still 
alive? (I dont want any information about it, just whether it's still 
connected).
2. has anyone already implemented such an advisory locking system? (rather 
than reinventing the wheel).
3. Is what I am trying to do just plain dumb! 

Many regards,
Ian Collins.
System Manager
KIWIPLAN NZ Ltd.

-
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