mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-29227 deprecate explicit_defaults_for_timestamp=0
This commit is contained in:
@@ -1326,6 +1326,8 @@ SET timestamp=DEFAULT;
|
|||||||
# MDEV-29225 make explicit_defaults_for_timestamps SESSION variable
|
# MDEV-29225 make explicit_defaults_for_timestamps SESSION variable
|
||||||
#
|
#
|
||||||
set explicit_defaults_for_timestamp=OFF;
|
set explicit_defaults_for_timestamp=OFF;
|
||||||
|
Warnings:
|
||||||
|
Warning 1681 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
|
||||||
create table t1 (f1 timestamp, f2 timestamp);
|
create table t1 (f1 timestamp, f2 timestamp);
|
||||||
show create table t1;
|
show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
|
@@ -48,6 +48,8 @@ ROLLBACK /* added by mysqlbinlog */;
|
|||||||
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
|
/*!50530 SET @@SESSION.PSEUDO_SLAVE_MODE=0*/;
|
||||||
connection slave;
|
connection slave;
|
||||||
set global explicit_defaults_for_timestamp=0;
|
set global explicit_defaults_for_timestamp=0;
|
||||||
|
Warnings:
|
||||||
|
Warning 1681 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
|
||||||
include/reset_slave.inc
|
include/reset_slave.inc
|
||||||
include/start_slave.inc
|
include/start_slave.inc
|
||||||
show create table t1;
|
show create table t1;
|
||||||
|
@@ -10,6 +10,8 @@ set @@session.explicit_defaults_for_timestamp = 1;
|
|||||||
connection slave;
|
connection slave;
|
||||||
set @sav.explicit_defaults_for_timestamp = @@global.explicit_defaults_for_timestamp;
|
set @sav.explicit_defaults_for_timestamp = @@global.explicit_defaults_for_timestamp;
|
||||||
set global explicit_defaults_for_timestamp = 0;
|
set global explicit_defaults_for_timestamp = 0;
|
||||||
|
Warnings:
|
||||||
|
Warning 1681 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
|
||||||
set @sav.slave_parallel_workers = @@global.slave_parallel_workers;
|
set @sav.slave_parallel_workers = @@global.slave_parallel_workers;
|
||||||
include/stop_slave.inc
|
include/stop_slave.inc
|
||||||
set @@global.slave_parallel_workers = 1;
|
set @@global.slave_parallel_workers = 1;
|
||||||
@@ -105,6 +107,8 @@ connection slave;
|
|||||||
# B. alternate the master and slave vars' values to (0,1)
|
# B. alternate the master and slave vars' values to (0,1)
|
||||||
connection master;
|
connection master;
|
||||||
set @@session.explicit_defaults_for_timestamp = 0;
|
set @@session.explicit_defaults_for_timestamp = 0;
|
||||||
|
Warnings:
|
||||||
|
Warning 1681 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
|
||||||
connection slave;
|
connection slave;
|
||||||
set @@global.explicit_defaults_for_timestamp = 1;
|
set @@global.explicit_defaults_for_timestamp = 1;
|
||||||
connection slave;
|
connection slave;
|
||||||
|
@@ -2,6 +2,8 @@ include/master-slave.inc
|
|||||||
[connection master]
|
[connection master]
|
||||||
set timestamp=1656940000;
|
set timestamp=1656940000;
|
||||||
set explicit_defaults_for_timestamp=!@@explicit_defaults_for_timestamp;
|
set explicit_defaults_for_timestamp=!@@explicit_defaults_for_timestamp;
|
||||||
|
Warnings:
|
||||||
|
Warning 1681 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
|
||||||
connection master;
|
connection master;
|
||||||
create table t1 (f1 timestamp, f2 timestamp);
|
create table t1 (f1 timestamp, f2 timestamp);
|
||||||
show create table t1;
|
show create table t1;
|
||||||
|
@@ -105,7 +105,9 @@ SET timestamp=DEFAULT;
|
|||||||
--echo #
|
--echo #
|
||||||
--echo # MDEV-29075 Changing explicit_defaults_for_timestamp within stored procedure works inconsistently
|
--echo # MDEV-29075 Changing explicit_defaults_for_timestamp within stored procedure works inconsistently
|
||||||
--echo #
|
--echo #
|
||||||
|
--disable_warnings
|
||||||
set statement explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp for create table t1 (ts timestamp);
|
set statement explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp for create table t1 (ts timestamp);
|
||||||
|
--enable_warnings
|
||||||
show create table t1;
|
show create table t1;
|
||||||
drop table t1;
|
drop table t1;
|
||||||
|
|
||||||
|
@@ -1,4 +1,6 @@
|
|||||||
set @@explicit_defaults_for_timestamp=0;
|
set @@explicit_defaults_for_timestamp=0;
|
||||||
|
Warnings:
|
||||||
|
Warning 1681 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
|
||||||
CREATE TABLE t1 (a TIMESTAMP);
|
CREATE TABLE t1 (a TIMESTAMP);
|
||||||
SHOW CREATE TABLE t1;
|
SHOW CREATE TABLE t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
@@ -224,6 +226,8 @@ t1 CREATE TABLE `t1` (
|
|||||||
`a` timestamp NULL DEFAULT NULL
|
`a` timestamp NULL DEFAULT NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||||
set explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp;
|
set explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp;
|
||||||
|
Warnings:
|
||||||
|
Warning 1681 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
|
||||||
execute stmt;
|
execute stmt;
|
||||||
show create table t1;
|
show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
|
@@ -233,6 +233,8 @@ t1 CREATE TABLE `t1` (
|
|||||||
`a` timestamp NULL DEFAULT NULL
|
`a` timestamp NULL DEFAULT NULL
|
||||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
) ENGINE=MyISAM DEFAULT CHARSET=latin1 COLLATE=latin1_swedish_ci
|
||||||
set explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp;
|
set explicit_defaults_for_timestamp=1-@@explicit_defaults_for_timestamp;
|
||||||
|
Warnings:
|
||||||
|
Warning 1681 'explicit_defaults_for_timestamp=0' is deprecated and will be removed in a future release
|
||||||
execute stmt;
|
execute stmt;
|
||||||
show create table t1;
|
show create table t1;
|
||||||
Table Create Table
|
Table Create Table
|
||||||
|
@@ -723,13 +723,24 @@ Sys_binlog_direct(
|
|||||||
CMD_LINE(OPT_ARG), DEFAULT(FALSE),
|
CMD_LINE(OPT_ARG), DEFAULT(FALSE),
|
||||||
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(binlog_direct_check));
|
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(binlog_direct_check));
|
||||||
|
|
||||||
|
static bool deprecated_explicit_defaults_for_timestamp(sys_var *self, THD *thd,
|
||||||
|
set_var *var)
|
||||||
|
{
|
||||||
|
if (var->value && var->save_result.ulonglong_value == 0)
|
||||||
|
push_warning_printf(thd, Sql_condition::WARN_LEVEL_WARN,
|
||||||
|
ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT,
|
||||||
|
ER_THD(thd, ER_WARN_DEPRECATED_SYNTAX_NO_REPLACEMENT),
|
||||||
|
"explicit_defaults_for_timestamp=0"); // since 11.0.0
|
||||||
|
return false;
|
||||||
|
}
|
||||||
static Sys_var_bit Sys_explicit_defaults_for_timestamp(
|
static Sys_var_bit Sys_explicit_defaults_for_timestamp(
|
||||||
"explicit_defaults_for_timestamp",
|
"explicit_defaults_for_timestamp",
|
||||||
"This option causes CREATE TABLE to create all TIMESTAMP columns "
|
"This option causes CREATE TABLE to create all TIMESTAMP columns "
|
||||||
"as NULL with DEFAULT NULL attribute, Without this option, "
|
"as NULL with DEFAULT NULL attribute, Without this option, "
|
||||||
"TIMESTAMP columns are NOT NULL and have implicit DEFAULT clauses.",
|
"TIMESTAMP columns are NOT NULL and have implicit DEFAULT clauses.",
|
||||||
SESSION_VAR(option_bits), CMD_LINE(OPT_ARG),
|
SESSION_VAR(option_bits), CMD_LINE(OPT_ARG),
|
||||||
OPTION_EXPLICIT_DEF_TIMESTAMP, DEFAULT(TRUE), NO_MUTEX_GUARD, IN_BINLOG);
|
OPTION_EXPLICIT_DEF_TIMESTAMP, DEFAULT(TRUE), NO_MUTEX_GUARD, IN_BINLOG,
|
||||||
|
ON_CHECK(deprecated_explicit_defaults_for_timestamp));
|
||||||
|
|
||||||
static Sys_var_ulonglong Sys_bulk_insert_buff_size(
|
static Sys_var_ulonglong Sys_bulk_insert_buff_size(
|
||||||
"bulk_insert_buffer_size", "Size of tree cache used in bulk "
|
"bulk_insert_buffer_size", "Size of tree cache used in bulk "
|
||||||
|
Reference in New Issue
Block a user