SET sql_mode=ORACLE;

--echo #
--echo # Start of 10.3 tests
--echo #

--echo #
--echo # MDEV-16152 Expressions with INTERVAL return bad results in some cases
--echo #

SELECT TIMESTAMP'2001-01-01 10:20:30' - INTERVAL '10' YEAR AS c1,
      -INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2;

SELECT TIMESTAMP'2001-01-01 10:20:30' + INTERVAL '10' YEAR AS c1,
       INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2,
      +INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c3;

EXPLAIN EXTENDED SELECT
  TIMESTAMP'2001-01-01 10:20:30' - INTERVAL '10' YEAR AS c1,
  -INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2;

EXPLAIN EXTENDED SELECT
  TIMESTAMP'2001-01-01 10:20:30' + INTERVAL '10' YEAR AS c1,
  INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c2,
  +INTERVAL '10' YEAR + TIMESTAMP'2001-01-01 10:20:30' AS c3;
