Troubles with Mysql + InnoDB

2001-12-14 Thread Dmirty Semenov

Hi!

At run of a script there is an error and the server falls. The script, 
the log file and my configuration follow.



Client output:
#mysql -p USTAT  test.sql
Password:
ERROR 2013 at line 22: Lost connection to MySQL server during query

-- begin script --
drop table if exists CARDS;
create table CARDS (
 NUM   SMALLINT unsigned not null,
 FIRM  VARCHAR(132)  not null default '',
 NAME  VARCHAR(80)   not null default '',
 CEMAILVARCHAR(80)   not null default '',
 NOTES VARCHAR(255)  not null default '',
 primary key (NUM)
) TYPE = InnoDB;

drop table if exists DOMAINS;
create table DOMAINS
(
 IDMEDIUMINTunsigned not null,
 NUM   SMALLINT unsigned not null, index DOMAINS_NUM (NUM),
 DOMAINVARCHAR(80)   not null,
 foreign key (NUM) references CARDS(NUM),
 primary key (ID)
) TYPE = InnoDB;

drop table if exists LOGINS;
create table LOGINS
(
 IDMEDIUMINTunsigned not null,
 NUM   SMALLINT unsigned not null, index LOGINS_NUM(NUM),
 LOGIN CHAR(33)  not null, index LOGINS_LOGIN(LOGIN),
 MAXSESTINYINT  unsigned not null default 0,
 MAXDAYMEDIUMINTunsigned not null default 0,
 MAXWEEK   MEDIUMINTunsigned not null default 0,
 MAXMONMEDIUMINTunsigned not null default 0,
 MAXTOTAL  INT  unsigned not null default 0,
 foreign key (NUM) references CARDS(NUM),
 primary key (ID)
) TYPE = InnoDB;
-- end script --

-- begin error log --
011214 14:28:38  mysqld restarted
011214 14:28:39  InnoDB: Started
/usr/libexec/mysqld: ready for connections
InnoDB: Assertion failure in thread 12299 in file dict0crea.c line 1237
InnoDB: We intentionally generate a memory trap.
InnoDB: Send a detailed bug report to [EMAIL PROTECTED]
mysqld got signal 11;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked agaist is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.
We will try our best to scrape up some info that will hopefully help 
diagnose
the problem, but since we have already crashed, something is definitely 
wrong
and this may fail

key_buffer_size=16773120
record_buffer=131072
sort_buffer=524280
max_used_connections=1
max_connections=100
threads_connected=2
It is possible that mysqld could use up to
key_buffer_size + (record_buffer + sort_buffer)*max_connections = 80379 K
bytes of memory
Hope that's ok, if not, decrease some variables in the equation

Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
Stack range sanity check OK, backtrace follows:
0x80b5694
0x40039eb4
0x8125c77
0x8128c8e
0x8139ffb
0x80ff8a2
0x80fa33d
0x80efb02
0x81043a0
0x80bc7dc
0x80bffd0
0x80bb3d1
0x80ba7d7
Stack trace seems successful - bottom reached
Please read http://www.mysql.com/doc/U/s/Using_stack_trace.html and 
follow instrstack trace is much more helpful in diagnosing the problem, 
so please do
resolve it
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort...

thd-query at 0x835c168 = create table LOGINS
(
 IDMEDIUMINTunsigned not null,
 NUM   SMALLINT unsigned not null, index LOGINS_NUM (NUM),
 LOGIN CHAR(33)  not null, index LOGINS_LOGIN (LOGIN),
 MAXSESTINYINT  unsigned not null default 0,
 MAXDAYMEDIUMINTunsigned not null default 0,
 MAXWEEK   MEDIUMINTunsigned not null default 0,
 MAXMONMEDIUMINTunsigned not null default 0,
 MAXTOTAL  INT  unsigned not null default 0,
 foreign key (NUM) references CARDS(NUM),
 primary key (ID)
) TYPE = InnoDB
thd-thread_id=4

Successfully dumped variables, if you ran with --log, take a look at the
details of what thread 4 did to cause the crash.  In some cases of really
bad corruption, the values shown above may be invalid

The manual page at http://www.mysql.com/doc/C/r/Crashing.html contains
information that should help you find out what is causing the crash

Number of processes running now: 0
011214 14:45:23  mysqld restarted
InnoDB: Database was not shut down normally.
InnoDB: Starting recovery from log files...
InnoDB: Starting log scan based on checkpoint at
InnoDB: log sequence number 0 193409
InnoDB: Doing recovery: scanned up to log sequence number 0 198497
InnoDB: Starting an apply batch of log records to the database...
InnoDB: Apply batch completed
011214 14:45:23  InnoDB: Started
/usr/libexec/mysqld: ready for connections
-- end error log --

-- begin my.cfn  --

Re: Troubles with Mysql + InnoDB

2001-12-14 Thread Heikki Tuuri

Hi!

I tried with 3.23.47, and the script did not fail.

The assertion failure means that adding of a foreign key constraint fails
because of some error number which should not happen.

You could modify and recompile MySQL so that mysql/innobase/dict0crea.c,
line 1237, would print the error code:

printf(Error code %lu\n, error);

But this may also be a compiler bug. Please try with a binary from
www.mysql.com and with a freshly created empty database. Does it still fail?

Regards,

Heikki
Innobase Oy
---
See http://www.innodb.com for the latest news about InnoDB
Order commercial MySQL/InnoDB support at https://order.mysql.com/


Hi!
At run of a script there is an error and the server falls. The script, 
the log file and my configuration follow.Client output:
#mysql -p USTAT  test.sqlPassword:
ERROR 2013 at line 22: Lost connection to MySQL server during query
-- begin script --
drop table if exists CARDS;create table CARDS (
 NUM   SMALLINT unsigned not null,
 FIRM  VARCHAR(132)  not null default '',
 NAME  VARCHAR(80)   not null default '',
 CEMAILVARCHAR(80)   not null default '',
 NOTES VARCHAR(255)  not null default '', primary key (NUM)
) TYPE = InnoDB;drop table if exists DOMAINS;create table DOMAINS(
 IDMEDIUMINTunsigned not null,
 NUM   SMALLINT unsigned not null, index DOMAINS_NUM (NUM),
 DOMAINVARCHAR(80)   not null,
 foreign key (NUM) references CARDS(NUM), primary key (ID)
) TYPE = InnoDB;drop table if exists LOGINS;create table LOGINS(
 IDMEDIUMINTunsigned not null,
 NUM   SMALLINT unsigned not null, index LOGINS_NUM(NUM),
 LOGIN CHAR(33)  not null, index LOGINS_LOGIN(LOGIN),
 MAXSESTINYINT  unsigned not null default 0,
 MAXDAYMEDIUMINTunsigned not null default 0,
 MAXWEEK   MEDIUMINTunsigned not null default 0,
 MAXMONMEDIUMINTunsigned not null default 0,
 MAXTOTAL  INT  unsigned not null default 0,
 foreign key (NUM) references CARDS(NUM), primary key (ID)
) TYPE = InnoDB;
-- end script --
-- begin error log --
011214 14:28:38  mysqld restarted011214 14:28:39  InnoDB: Started
/usr/libexec/mysqld: ready for connections
InnoDB: Assertion failure in thread 12299 in file dict0crea.c line 1237
InnoDB: We intentionally generate a memory trap.
InnoDB: Send a detailed bug report to [EMAIL PROTECTED] got
signal 11;


mysql drop table if exists CARDS;
Query OK, 0 rows affected (0.00 sec)

mysql
mysql create table CARDS (
-  NUM   SMALLINT unsigned not null,
-  FIRM  VARCHAR(132)  not null default '',
-  NAME  VARCHAR(80)   not null default '',
-  CEMAILVARCHAR(80)   not null default '',
-  NOTES VARCHAR(255)  not null default '', primary key
 (NUM)
- ) TYPE = InnoDB;
Query OK, 0 rows affected (0.01 sec)

mysql
mysql drop table if exists DOMAINS;
Query OK, 0 rows affected (0.00 sec)

mysql
mysql create table DOMAINS(
-  IDMEDIUMINTunsigned not null,
-  NUM   SMALLINT unsigned not null, index DOMAINS_NUM (NUM),
-  DOMAINVARCHAR(80)   not null,
-  foreign key (NUM) references CARDS(NUM), primary key (ID)
- ) TYPE = InnoDB;
Query OK, 0 rows affected (0.04 sec)

mysql
mysql drop table if exists LOGINS;
Query OK, 0 rows affected (0.00 sec)

mysql
mysql create table LOGINS(
-  IDMEDIUMINTunsigned not null,
-  NUM   SMALLINT unsigned not null, index LOGINS_NUM(NUM),
-  LOGIN CHAR(33)  not null, index LOGINS_LOGIN(LOGIN),
-  MAXSESTINYINT  unsigned not null default 0,
-  MAXDAYMEDIUMINTunsigned not null default 0,
-  MAXWEEK   MEDIUMINTunsigned not null default 0,
-  MAXMONMEDIUMINTunsigned not null default 0,
-  MAXTOTAL  INT  unsigned not null default 0,
-  foreign key (NUM) references CARDS(NUM), primary key (ID)
- ) TYPE = InnoDB;
Query OK, 0 rows affected (0.05 sec)

mysql
mysql show table status from test like 'DOMAINS';
+-+++--++-+-
+--+---++-+-
+++-
+
| Name| Type   | Row_format | Rows | Avg_row_length | Data_length | Max_data
_length | Index_length | Data_free | Auto_increment | Create_time | Update_time
| Check_time | Create_options | Comment
|
+-+++--++-+-