Hi!

>>>>> "Peter" == Peter Zaitsev <[EMAIL PROTECTED]> writes:

Peter> Hello mysql,
Peter>   Resently I've found a problem when I was trying to upgrade from
Peter>   3.23.32 to 3.23.36, well I had a same problem then tried to upgrade
Peter>   to 3.23.33 so decided to wait a bit, but now i think I should check
Peter>   more about this.

Peter>   The problem is the followings: Sometimes then I rename a table I get
Peter>   the following strange error, therefore sometimes I do not. I do not
Peter>   use transactions and do not lock anything at this point but it
Peter>   sometimes happens:

mysql> create table test1 ( id int );
Peter> Query OK, 0 rows affected (0.00 sec)

mysql> create table test2 ( id int );
Peter> Query OK, 0 rows affected (0.00 sec)

mysql> rename tables test1 to test3, test2 to test1, test3 to test2;
Peter> ERROR 1192: Can't execute the given command because you have active locked
Peter> tables or an active transaction

Peter> The same problem may appear even then using just first part of rename
Peter> statement.

Peter> I tried many different things like trying to flush tables before
Peter> trying to rename them, trying to start and commit a transaction before
Peter> or lock and unlock tables nothing helps but after restarting mysql I
Peter> get ride of this problem.

Peter> Also I found what after this problem appears there is no way to get a
Peter> ride from it without restarting mysql.

I bet this happens when you have a server that is compiled w
transaction support but you are using --skip-bdb and --skip-innobase ?

Here is a fix for this:

(/my/mysql) bk diffs -c sql/sql_class.cc
===== sql/sql_class.cc 1.51 vs edited =====
*** /tmp/sql_class.cc-1.51-4024 Mon Mar 26 01:05:03 2001
--- edited/sql/sql_class.cc     Thu Mar 29 19:55:42 2001
***************
*** 136,144 ****
            (hash_get_key) get_var_key,
            (void (*)(void*)) free_var,0);
  #ifdef USING_TRANSACTIONS
    if (opt_using_transactions)
    {
-     bzero((char*) &transaction,sizeof(transaction));
      if (open_cached_file(&transaction.trans_log,
                         mysql_tmpdir, LOG_PREFIX, binlog_cache_size,
                         MYF(MY_WME)))
--- 136,144 ----
            (hash_get_key) get_var_key,
            (void (*)(void*)) free_var,0);
  #ifdef USING_TRANSACTIONS
+   bzero((char*) &transaction,sizeof(transaction));
    if (opt_using_transactions)
    {
      if (open_cached_file(&transaction.trans_log,
                         mysql_tmpdir, LOG_PREFIX, binlog_cache_size,
                         MYF(MY_WME)))

Regards,
Monty

---------------------------------------------------------------------
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