[MDEV-16471] mysqldump throws "Variable 'sql_mode' can't be set to the value of 'NULL' (1231)" Created: 2018-06-12  Updated: 2018-06-21  Resolved: 2018-06-21

Status: Closed
Project: MariaDB Server
Component/s: Backup
Affects Version/s: 10.3.7
Fix Version/s: 10.3.8

Type: Bug Priority: Blocker
Reporter: DP (Inactive) Assignee: Alexander Barkov
Resolution: Fixed Votes: 0
Labels: Compatibility
Environment:

CentOS Linux release 7.3.1611 (3.10.0-514.26.2.el7.x86_64)


Issue Links:
Relates
relates to MDEV-14013 sql_mode=EMPTY_STRING_IS_NULL Closed

 Description   

After upgrading to MariaDB 10.3.7 am not able to take backup using mysqldump;

Steps to reproduce:

MariaDB [(none)]> create database testdb;
Query OK, 1 row affected (0.001 sec)
 
MariaDB [(none)]> use testdb;
Database changed
 
MariaDB [testdb]> create table test123 (c1 varchar(10));
Query OK, 0 rows affected (0.004 sec)
 
#mysqldump -uroot -pxxxxxxxx --port=3306 --databases testdb  >  testdb.sql
 
mysqldump: Couldn't execute '/*!40100 SET @@SQL_MODE='' */': Variable 'sql_mode' can't be set to the value of 'NULL' (1231)



 Comments   
Comment by Alice Sherepa [ 2018-06-12 ]

Reproduced on MariaDB 10.3 with SET global sql_mode='ORACLE,EMPTY_STRING_IS_NULL';

Comment by DP (Inactive) [ 2018-06-12 ]

Yes, we have EMPTY_STRING_IS_NULL sql_mode enabled.

Comment by Alexander Barkov [ 2018-06-21 ]

A simple SQL script demonstrating the problem:

SET sql_mode='ORACLE,EMPTY_STRING_IS_NULL';
SET sql_mode='';

ERROR 1231 (42000): Variable 'sql_mode' can't be set to the value of 'NULL'

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