Error 11 (can"t unlock file) in different places for sp vs script

Error 11 (can"t unlock file) in different places for sp vs script

am 16.02.2006 21:45:04 von M

Hi,
I'm running MySQL (5.0.18-nt) on WinXP with latest patches.

I've some SQL code that generates an 'ERROR 11' in two different places
depending on how the code is submitted.
At the moment I'de like to find out what is causing the error, so I
haven't included the code, which is quite lengthy.

I'm not a MySQL (or anyother db) expert, but I've turned on isam
logging and run the myisamlog utility which didn't seem to be the right
tool...?

I'd like to know how I can find out what is causing this error. Any
suggestions appreciated.

If submitted via:
mysql -u root -e "SOURCE "./../SQL/code.sql";"

the error occurs in the _third_ 'part' of the script (line 131 referred
to is between an insert and a select statement). the error message is:

ERROR 11 (HY000) at line 131 in file: 'D:\MySQL\SQL\code.sql': Can't
unlock file (Errcode: 11)

If submitted via:
mysql -u root -e "CALL `taq`.`sp_code`();"

the error occurs in the _first_ 'part' of the script. the error
message is:

ERROR 11 (HY000) at line 1: Can't unlock file (Errcode: 11)

Re: Error 11 (can"t unlock file) in different places for sp vs script

am 16.02.2006 22:09:08 von Bill Karwin

"m" wrote in message
news:1140122704.511617.96920@g44g2000cwa.googlegroups.com...
> I'd like to know how I can find out what is causing this error. Any
> suggestions appreciated.
>
> ERROR 11 (HY000) at line 131 in file: 'D:\MySQL\SQL\code.sql': Can't
> unlock file (Errcode: 11)

Well, since you don't describe the database schema, activity on the server,
or the statements that are executing when you get this error, there's not
much to go on here...

My usual first step in diagnosing an error I haven't seen before is a Google
search for search terms containing the error. Sometimes I can get clues
from past discussions about the same symptoms. For example, search Google
for:

mysql "can't unlock file" "error 11"

This search reveals a number of pages with MySQL bug reports and past MySQL
list traffic on this topic, mostly the resolution is that the user was
running myisamchk while MySQL service is running.

Regards,
Bill K.

Re: Error 11 (can"t unlock file) in different places for sp vs script

am 17.02.2006 09:05:24 von M

Hi Bill,
Thanks for your response. I had done as you suggest and had ruled out
the 'server running explanation.
I get this error from the mysql server (rather than myisamchk) and in
two different ways from the same code depending on whether it is run
via a stored procedure or as a script.

Good to know there was some other 'obvious' tool/technique I had over
looked.
Cheers
Mark

Re: Error 11 (can"t unlock file) in different places for sp vs script

am 17.02.2006 10:14:29 von M

I have a two SQL files that contain example scripts that should
generate the behavior I refer to. One script contains some data and is
160K, the other about 300bytes.
If anyone is interested in receiving these let me know and I'll email
them.

The show warnings indicates the Errcode 11: is not all that is going
wrong:

The SHOW WARNINGS; statement produces the following:
+---------+------+------------------------------------------ ---------------------+
| Level | Code | Message
|
+---------+------+------------------------------------------ ---------------------+
| Error | 11 | Can't unlock file (Errcode: 11)
|
| Error | 1105 | Unknown error
|
| Warning | 1196 | Some non-transactional changed tables couldn't
be rolled back|
+---------+------+------------------------------------------ ---------------------+

Regards
Mark