Bug #21751 Uninformative MySQL Cluster error messages for non-existing tablespaces
Submitted: 21 Aug 2006 12:24 Modified: 1 Sep 2006 16:28
Reporter: Roland Bouman Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Cluster: Disk Data Severity:S3 (Non-critical)
Version:5.1.11 OS:
Assigned to: Jonas Oreland CPU Architecture:Any
Tags: cluster, error messages

[21 Aug 2006 12:24] Roland Bouman
Description:
Some of the MySQL Cluster error messages are uninformative, if not misleading. 

1) Creating a table for a non-existant tablespace returns 

ERROR 1005 (HY000): Can't create table '<db>.<table>' (errno: 155)

2) Dropping a datafile from a non-existant tablespace returns 

ERROR 1520 (HY000): Failed to alter:  DROP DATAFILE

Also, the perror utility does not help at all in these particular cases.

How to repeat:
(in the commandline client)

use test;

create table bla(
id int
) 
tablespace idonotexist
storage disk
engine ndb
;

ERROR 1005 (HY000): Can't create table 'test.bla' (errno: 155)

(in the shell: )

./perror 1005 

Illegal error code: 1005

./perror --ndb 155

NDB error code 155: No message slogan found (please report a bug if you get this error code): Unknown: Unknown

(in the commandline client)

alter tablespace idonotexist drop datafile 'ts_haworld1_data1.dat' engine ndb;

ERROR 1520 (HY000): Failed to alter:  DROP DATAFILE

(in the shell:)

./perror 1520 
Illegal error code: 1520

./perror --ndb 1520
NDB error code 1520: No message slogan found (please report a bug if you get this error code): Unknown: Unknown

(not that this error only occurs when the datafile does in fact exist; for example, in another tablespace)

Suggested fix:
at least, perror should shed some light on the error messages. 

In both described cases (Can't create table) the message should include additional information that tells the user something about the underlying cause of the problem, something like:

Tablespace '<tsname>' does not exist.
[21 Aug 2006 12:56] Jonas Oreland

 
[21 Aug 2006 12:57] Jonas Oreland
mysql> create table bla (id int)  tablespace idonotexist storage disk  engine
ndb;
ERROR 1005 (HY000): Can't create table 'test.bla' (errno: 140)
mysql> show warnings;
+-------+------+---------------------------------------------+
| Level | Code | Message                                     |
+-------+------+---------------------------------------------+
| Error | 1296 | Got error 755 'Invalid tablespace' from NDB | 
| Error | 1005 | Can't create table 'test.bla' (errno: 140)  | 
+-------+------+---------------------------------------------+
2 rows in set (0.00 sec)

mysql>
[1 Sep 2006 8:15] Jonas Oreland
pushed to 5.1.12, see http://bugs.mysql.com/bug.php?id=16310
for details
[1 Sep 2006 16:28] Jon Stephens
Thank you for your bug report. This issue has been committed to our source repository of that product and will be incorporated into the next release.

If necessary, you can access the source repository and build the latest available version, including the bug fix. More information about accessing the source trees is available at

    http://dev.mysql.com/doc/en/installing-source.html

Documented bugfix in 5.1.12 changelog.