[MDEV-18864] SQL mode MAXDB has undocumented side-effects Created: 2019-03-08  Updated: 2019-05-03  Resolved: 2019-05-03

Status: Closed
Project: MariaDB Server
Component/s: Documentation, Variables
Affects Version/s: 5.5, 10.0, 10.1, 10.2, 10.3, 10.4
Fix Version/s: N/A

Type: Bug Priority: Minor
Reporter: Elena Stepanova Assignee: Ian Gilfillan
Resolution: Fixed Votes: 0
Labels: upstream-fixed


 Description   

SQL_MODE MAXDB is documented as an equivalent of PIPES_AS_CONCAT, ANSI_QUOTES, IGNORE_SPACE, MAXDB, NO_KEY_OPTIONS, NO_TABLE_OPTIONS, NO_FIELD_OPTIONS, NO_AUTO_CREATE_USER. It's a recursive definition in itself, the only meaningful way to read it is that it's an equivalent of the combination of the other listed modes; but it is not. At least one extra effect is that MAXDB mode makes timestamp be converted into datetime, while the combination of the listed modes doesn't:

set sql_mode= 'MAXDB';
create table t1 (t timestamp);
show create table t1;
Table	Create Table
t1	CREATE TABLE "t1" (
  "t" datetime DEFAULT NULL
)
drop table t1;
set sql_mode= 'PIPES_AS_CONCAT,ANSI_QUOTES,IGNORE_SPACE,NO_KEY_OPTIONS,NO_TABLE_OPTIONS,NO_FIELD_OPTIONS,NO_AUTO_CREATE_USER';
create table t1 (t timestamp);
show create table t1;
Table	Create Table
t1	CREATE TABLE "t1" (
  "t" timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
)

It was the same in MySQL up to an including 5.6; in 5.7 MAXDB mode was deprecated, and a warning about implicit conversion was returned. in 8.0, the mode is removed.

At least the documentation needs to be updated, but maybe MariaDB doesn't need the mode either?


Generated at Thu Feb 08 08:47:19 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.