Bug #64402 MySQL crashes at CREATE INDEX
Submitted: 21 Feb 2012 21:07 Modified: 22 Mar 2012 19:45
Reporter: Arnold Voykov Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Errors Severity:S1 (Critical)
Version:5.5.20 OS:FreeBSD (8)
Assigned to: CPU Architecture:Any

[21 Feb 2012 21:07] Arnold Voykov
Description:
Importing http://svn.wikimedia.org/svnroot/mediawiki/branches/REL1_19/phase3/maintenance/tables.sql returns error:

mysql> CREATE INDEX /*i*/user_email_token ON /*_*/user (user_email_token);
ERROR 2013 (HY000): Lost connection to MySQL server during query

How to repeat:
$ curl http://svn.wikimedia.org/svnroot/mediawiki/branches/REL1_19/phase3/maintenance/tables.sql > tables.sql
$ mysql -u name -p dbname < tables.sql
[22 Feb 2012 5:08] Valeriy Kravchuk
I do not see this problem:

macbook-pro:5.5 openxs$ bin/mysql -uroot test < ~/Documents/tables.sql 
macbook-pro:5.5 openxs$ bin/mysql -uroot test -e "select version()";
+--------------+
| version()    |
+--------------+
| 5.5.20-debug |
+--------------+

Please, send error log of your MySQL server.
[22 Feb 2012 11:35] Arnold Voykov
error log:

120221 20:56:11 mysqld_safe mysqld restarted
120221 20:56:11 InnoDB: The InnoDB memory heap is disabled
120221 20:56:11 InnoDB: Mutexes and rw_locks use GCC atomic builtins
120221 20:56:11 InnoDB: Compressed tables use zlib 1.2.3
120221 20:56:11 InnoDB: Initializing buffer pool, size = 32.0M
120221 20:56:11 InnoDB: Completed initialization of buffer pool
120221 20:56:11 InnoDB: highest supported file format is Barracuda.
InnoDB: Log scan progressed past the checkpoint lsn 1680694
120221 20:56:11  InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Restoring possible half-written data pages from the doublewrite
InnoDB: buffer...
InnoDB: Doing recovery: scanned up to log sequence number 1682271
120221 20:56:11  InnoDB: Starting an apply batch of log records to the database...
InnoDB: Progress in percents: 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
InnoDB: Apply batch completed
120221 20:56:11  InnoDB: Waiting for the background threads to start
120221 20:56:12 InnoDB: 1.1.8 started; log sequence number 1682271
120221 20:56:12 [Note] Recovering after a crash using mysql-bin
120221 20:56:12 [Note] Starting crash recovery...
120221 20:56:12 [Note] Crash recovery finished.
120221 20:56:12 [Note] Event Scheduler: Loaded 0 events
120221 20:56:12 [Note] /usr/local/libexec/mysqld: ready for connections.
Version: '5.5.20-log'  socket: '/tmp/mysql.sock'  port: 3306  Source distribution

my.cnf:

[client]
port            = 3306
socket          = /tmp/mysql.sock
log             = /var/log/mysql.log

[mysqld]
port            = 3306
socket          = /tmp/mysql.sock
bind-address    = 127.0.0.1
skip-external-locking
key_buffer_size = 16M
max_allowed_packet = 2M
table_open_cache = 64
sort_buffer_size = 512K
net_buffer_length = 8K
read_buffer_size = 256K
read_rnd_buffer_size = 512K
myisam_sort_buffer_size = 8M
character_set_server=utf8

server-id       = 1

# Uncomment the following if you are using InnoDB tables
innodb_data_home_dir = /var/db/mysql
innodb_data_file_path = ibdata1:10M:autoextend
innodb_log_group_home_dir = /var/db/mysql
# You can set .._buffer_pool_size up to 50 - 80 %
# of RAM but beware of setting memory usage too high
innodb_buffer_pool_size = 32M
innodb_additional_mem_pool_size = 2M
# Set .._log_file_size to 25 % of buffer pool size
innodb_log_file_size = 5M
innodb_log_buffer_size = 8M
innodb_flush_log_at_trx_commit = 1
innodb_lock_wait_timeout = 50

[mysqldump]
quick
max_allowed_packet = 16M

[mysql]
no-auto-rehash
# Remove the next comment character if you are not familiar with SQL
#safe-updates

[myisamchk]
key_buffer_size = 12M
sort_buffer_size = 12M
read_buffer = 2M
write_buffer = 2M

[mysqlhotcopy]
interactive-timeout

Server:
# uname -a
FreeBSD temphost 8.2-STABLE FreeBSD 8.2-STABLE #0 r112:113: Mon Dec 19 08:17:00 IRKT 2011     root@freebsd8-amd64.ispsystem.net:/root/src/sys/amd64/compile/ISPSYSTEM  amd64
[22 Feb 2012 13:32] MySQL Verification Team
I couldn't repeat on Windows 64-bits with too.
[22 Feb 2012 18:23] MySQL Verification Team
mysql 5.5 >SHOW CREATE TABLE user\G
*************************** 1. row ***************************
       Table: user
Create Table: CREATE TABLE `user` (
  `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `user_real_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `user_password` tinyblob NOT NULL,
  `user_newpassword` tinyblob NOT NULL,
  `user_newpass_time` binary(14) DEFAULT NULL,
  `user_email` tinytext NOT NULL,
  `user_touched` binary(14) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
  `user_token` binary(32) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
  `user_email_authenticated` binary(14) DEFAULT NULL,
  `user_email_token` binary(32) DEFAULT NULL,
  `user_email_token_expires` binary(14) DEFAULT NULL,
  `user_registration` binary(14) DEFAULT NULL,
  `user_editcount` int(11) DEFAULT NULL,
  PRIMARY KEY (`user_id`),
  UNIQUE KEY `user_name` (`user_name`),
  KEY `user_email_token` (`user_email_token`),
  KEY `user_email` (`user_email`(50))
) ENGINE=InnoDB DEFAULT CHARSET=utf8
1 row in set (0.00 sec)

mysql 5.5 >SHOW VARIABLES LIKE "%version%";
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| innodb_version          | 1.1.8               |
| protocol_version        | 10                  |
| slave_type_conversions  |                     |
| version                 | 5.5.23              |
| version_comment         | Source distribution |
| version_compile_machine | x86                 |
| version_compile_os      | Win64               |
+-------------------------+---------------------+
7 rows in set (0.00 sec)
[22 Feb 2012 18:29] Arnold Voykov
>show create table user;
CREATE TABLE `user` (
  `user_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `user_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `user_real_name` varchar(255) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL DEFAULT '',
  `user_password` tinyblob NOT NULL,
  `user_newpassword` tinyblob NOT NULL,
  `user_newpass_time` binary(14) DEFAULT NULL,
  `user_email` tinytext NOT NULL,
  `user_touched` binary(14) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
  `user_token` binary(32) NOT NULL DEFAULT '\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0',
  `user_email_authenticated` binary(14) DEFAULT NULL,
  `user_email_token` binary(32) DEFAULT NULL,
  `user_email_token_expires` binary(14) DEFAULT NULL,
  `user_registration` binary(14) DEFAULT NULL,
  `user_editcount` int(11) DEFAULT NULL,
  PRIMARY KEY (`user_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8

>SHOW VARIABLES LIKE "%version%";
+-------------------------+---------------------+
| Variable_name           | Value               |
+-------------------------+---------------------+
| innodb_version          | 1.1.8               |
| protocol_version        | 10                  |
| slave_type_conversions  |                     |
| version                 | 5.5.20              |
| version_comment         | Source distribution |
| version_compile_machine | amd64               |
| version_compile_os      | FreeBSD8.2          |
+-------------------------+---------------------+
7 rows in set (0.01 sec)
[22 Feb 2012 19:35] Sveta Smirnova
Thank you for the feedback.

I can not repeat described problem on FreeBSD8 too. Please upgrade to current version 5.5.21, try with it and if problem still exists inform us about package  you use (file name you downloaded)
[22 Feb 2012 19:44] Arnold Voykov
I use mysql55-server from ports:

cd /usr/ports/databases/mysql55-server/
make config
make install clean
[22 Feb 2012 19:45] Sveta Smirnova
Thank you for the feedback.

Please try in your environment with our binaries available from http://dev.mysql.com/downloads to be sure this is not the port problem.
[23 Mar 2012 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".