List:General Discussion« Previous MessageNext Message »
From:greg.webber Date:October 4 1999 7:18am
Subject:mysql daemon dies on 'alter table' with 'after' specifying last col
View as plain text  
>Description:
If you attempt to execute an 'alter table' SQL statement that includes an
'add column' together with an 'after col_name' where col_name is the last
column (in which case there was no point putting it there anyway with the
current behaviour of 'add column' which puts it at the end), the server
dies.

In addition one process is left hanging around which must be manually killed
before the server can be brought up again via the init.d script.  You'll see
(part of the reason) why when you try to pull it down using the init.d
(missing files in /var/lib/mysql).

>How-To-Repeat:
create database temp;
use temp;

#this table is from my app (with renamed cols)
create table mytable (
col1 int not null auto_increment primary key,
col2 varchar(30) not null,
col3 varchar (20) not null,
col4 varchar(4) not null,
col5 enum('PENDING', 'ACTIVE', 'DISABLED') not null,
col6 int not null);

#this is the change I attempt to make
alter table mytable
add column col4_5 varchar(20) not null after col4,
add column col7 varchar(30) not null after col6,
add column col8 datetime not null;

>Fix:
If the column specified together with 'after' is the last (right-most) column,
then omit it since it will be placed there anyway in the absence of any other
directives.

>Submitter-Id:	<submitter ID>
>Originator:	
>Organization:
>MySQL support: [licence]
>Synopsis:	server crashes on particular usage of alter table statement.
>Severity: critical
>Priority:	low
>Category:	mysql
>Class:		sw-bug 
>Release:	mysql-3.22.25 (Source distribution)
>Server: /usr/bin/mysqladmin  Ver 7.11 Distrib 3.22.25, for pc-linux-gnu on i686
TCX Datakonsult AB, by Monty

Server version		3.22.25
Protocol version	10
Connection		Localhost via UNIX socket
UNIX socket		/var/lib/mysql/mysql.sock
Uptime:			29 min 2 sec

Threads: 1  Questions: 58  Slow queries: 0  Opens: 75  Flush tables: 1  Open tables: 2
>Environment:
	
System: Linux assm06.epa.ericsson.se 2.2.5-15 #1 Mon Apr 19 22:21:09 EDT 1999 i586 unknown
Architecture: i586

Some paths:  /usr/bin/perl /usr/bin/make /usr/bin/gmake /usr/bin/gcc /usr/bin/cc
GCC: Reading specs from /usr/lib/gcc-lib/i386-redhat-linux/egcs-2.91.66/specs
gcc version egcs-2.91.66 19990314/Linux (egcs-1.1.2 release)
Compilation info: CC='egcs'  CFLAGS='-O6 -fomit-frame-pointer -mpentium'  CXX='egcs' 
CXXFLAGS='-O6 -fomit-frame-pointer 	          -felide-constructors -fno-exceptions
-fno-rtti -mpentium'  LDFLAGS=''
Configure command: ./configure  --enable-shared --enable-assembler --disable-shared
--with-mysqld-ldflags=-all-static --with-client-ldflags=-all-static
--with-mysqld-user=mysql --with-unix-socket-path=/var/lib/mysql/mysql.sock --prefix=/
--exec-prefix=/usr --libexecdir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share
--localstatedir=/var/lib/mysql --infodir=/usr/info --includedir=/usr/include
--mandir=/usr/man
Perl: This is perl, version 5.005_03 built for i386-linux
Thread
mysql daemon dies on 'alter table' with 'after' specifying last colgreg.webber4 Oct
  • mysql daemon dies on 'alter table' with 'after' specifying last colMichael Widenius6 Oct