On Windows® - but I guess it’s the same on another O.S. that does not support cluster - I noticed the following behavior when trying to execute a CREATE LOGFILE GROUP syntax like this:
CREATE
LOGFILE GROUP `test`
ADD UNDOFILE ‘test’
INITIAL_SIZE = 33M
UNDO_BUFFER_SIZE = 8M
ENGINE = NDBCLUSTER;
In v.5.1.25-rc, v.5.1.24-rc and v.5.1.23-rc, only SQL warnings are shown:
mysql> CREATE
-> LOGFILE GROUP `test`
-> ADD UNDOFILE ‘test’
-> INITIAL_SIZE = 33M
-> UNDO_BUFFER_SIZE = 8M
-> ENGINE = NDBCLUSTER;
Query OK, 0 rows affected, 2 warnings (0.01 sec)
mysql> SHOW WARNINGS;
+———+——+————————————————————————————————+
| Level | Code | Message
|
+———+——+————————————————————————————————+
| Warning | 1286 | Unknown table engine ‘NDBCLUSTER’
|
| Error | 1478 | Table storage engine ‘MyISAM’ does not support the create option ‘TABLESPACE or LOGFILE GROUP’ |
+———+——+————————————————————————————————+
2 rows in set (0.00 sec)
In v.6.0.5-alpha a SQL error occurs:
mysql> CREATE
-> LOGFILE GROUP `test`
-> ADD UNDOFILE ‘test’
-> INITIAL_SIZE = 33M
-> UNDO_BUFFER_SIZE = 8M
-> ENGINE = NDBCLUSTER;
ERROR 1478 (HY000): Table storage engine ‘MyISAM’ does not support the create option ‘TABLESPACE or LOGFILE GROUP’
This difference can generate a bug in your applications if you were using code like this:
IF mysql.error = 0 THEN
ok, post-creation operations
ELSE
error, do nothing
In fact, the code above is correct if used on v.6.0.5 but it is wrong if used on v.5.1.25 (the application executes the post-creation operations even if the logfile group hasn’t been created).
I don’t remember exactly which version, but an old 5.1.x version had the same behavior of v.6.0.5 - i.e. SQL error - and that was the reason why I coded in that way.
Well.. one more application-bug discovered while testing the version 6.0.5-alpha of the server.
This afternoon I changed the code in this way:
IF (mysql.error = 0 AND mysql.warnings=0) THEN
ok, post-creation operations
ELSE
error, do nothing
uhmm, I would like to read such changes (errors -> warnings) in the internal mailing list or in the release notes file of the server (indeed, I’m not sure if it’s included in the chapter “Changes in release 5.1.x”).
Moral: