List:General Discussion« Previous MessageNext Message »
From:<sp4mv0rt3x-mysql Date:May 12 2004 6:22pm
Subject:unexpected create table as lock issue
View as plain text  
I have a table called web_master which has as a
primary key column called web_id.

When I try to create another table as a select, I get
the following error message [note, that group_id is
indexed]:

mysql> create table sort_test as select * from
web_master where group_id = 69; 
 ERROR 1205: Lock wait timeout exceeded; Try
restarting transaction 


There aren't any other transactions running in the
database, so I do not understand why there is any lock
wait.. 

Creating the table, then populating it via inserts
works. ie:


mysql> create table sort_test (id bigint(20)); 
 Query OK, 0 rows affected (0.17 sec) 
  
 mysql> insert into sort_test 
     -> select web_id 
     ->   from web_master 
     ->  where group_id = 69; 
 Query OK, 6698 rows affected (0.22 sec) 
 Records: 6698  Duplicates: 0  Warnings: 0 
  
 mysql> commit; 
 Query OK, 0 rows affected (0.00 sec) 


Any thoughts on why I am getting the lock wait
timeout?
 

Thread
unexpected create table as lock issuesp4mv0rt3x-mysql12 May
  • Re: unexpected create table as lock issueSasha Pachev13 May
  • Re: unexpected create table as lock issueHeikki Tuuri13 May
Re: unexpected create table as lock issuesp4mv0rt3x-mysql14 May
Re: unexpected create table as lock issueHeikki Tuuri17 May