Description:
When sql_mode='traditional', we would like to return an error
in situations where syntax is used that is invalid for the MySQL
version.
For example, in default mode, a CREATE TABLE statement
that specifies a storage engine which is not compiled in results
in a MyISAM table. In "traditional" mode, this should return an
error and the table should not be created. That is (assume BDB
tables are not available):
SET SQL_MODE='TRADITIONAL';
CREATE TABLE t1 (col1 INT) ENGINE=BDB;
-- should return SQLSTATE HY000 BDB storage engine not compiled in
(or a similar message)
How to repeat:
Assume BDB tables are not compiled in.
mysql> create table t1 (col1 int) engine=bdb;
Query OK, 0 rows affected, 1 warning (0.11 sec)
mysql> show warnings;
+---------+------+--------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------+
| Warning | 1266 | Using storage engine MyISAM for table 't1' |
+---------+------+--------------------------------------------+
1 row in set (0.00 sec)
mysql> set sql_mode='traditional';
mysql> create table t2 (col1 int) engine=bdb;
Query OK, 0 rows affected, 1 warning (0.11 sec)
-- This is the incorrect result. The table should not be created.
mysql> show warnings;
+---------+------+--------------------------------------------+
| Level | Code | Message |
+---------+------+--------------------------------------------+
| Warning | 1266 | Using storage engine MyISAM for table 't2' |
+---------+------+--------------------------------------------+
1 row in set (0.00 sec)