--source include/have_falcon.inc
#
# Bug #22167: update ignore feature is missing
#
--echo *** Bug #22167 ***

# ----------------------------------------------------- #
# --- Initialisation                                --- #
# ----------------------------------------------------- #
let $engine = 'Falcon';
eval SET @@storage_engine = $engine;

--disable_warnings
DROP TABLE IF EXISTS t1;
DROP TABLE IF EXISTS t2;
--enable_warnings

CREATE TABLE t1 (
  id int not null,
  name char(20) not null,
  primary key (id)
);

CREATE TABLE t2 (
  id int unsigned not null auto_increment,
  code tinyint unsigned not null,
  name char(20) not null,
  primary key (id),
  key (code),
  unique (name)
);

# ----------------------------------------------------- #
# --- Test                                          --- #
# ----------------------------------------------------- #
INSERT INTO t1 (id, name) VALUES (1, 'Tim'), (2, 'Monty');
SELECT id, name FROM t1 ORDER BY id;

UPDATE IGNORE t1 SET id = 8, name = 'Sinisa' WHERE id < 3;
SELECT count(*) FROM t1 WHERE name = 'Sinisa';

INSERT INTO t2 (code, name) VALUES (1, 'Tim'), (1, 'Monty');
SELECT id, code, name FROM t2 ORDER BY id;

UPDATE IGNORE t2 SET id = 8, name = 'Sinisa' WHERE id < 3;
SELECT count(*) FROM t2 WHERE name = 'Sinisa';

# ----------------------------------------------------- #
# --- Check                                         --- #
# ----------------------------------------------------- #
SELECT count(*) FROM t1;
SELECT count(*) FROM t2;

# ----------------------------------------------------- #
# --- Final cleanup                                 --- #
# ----------------------------------------------------- #
DROP TABLE t1;
DROP TABLE t2;
