Commit 8f0e7528 authored by Olivier Bertrand's avatar Olivier Bertrand

- Adding a test for indexed UPDATE/DELETE

added:
  storage/connect/mysql-test/connect/r/updelx.result
  storage/connect/mysql-test/connect/t/updelx.inc
  storage/connect/mysql-test/connect/t/updelx.test
parent da69d41a
This diff is collapsed.
DELETE FROM t1;
INSERT INTO t1 VALUES(4, 'four'),(7,'seven'),(10,'ten'),(40,'forty'),(60,'sixty'),(81,'eighty one'),(72,'seventy two'),(11,'eleven'),(1,'one'),(35,'thirty five'),(8,'eight');
SELECT * FROM t1;
UPDATE t1 SET msg = 'bof' WHERE id = 35;
SELECT * FROM t1;
UPDATE t1 SET msg = 'big' WHERE id > 50;
SELECT * FROM t1;
UPDATE t1 SET msg = 'updated' WHERE id IN (8,35,60,72);
SELECT * FROM t1;
UPDATE t1 SET msg = 'twin' WHERE id IN (81,10);
SELECT * FROM t1;
UPDATE t1 SET msg = 'sixty' WHERE id = 60;
SELECT * FROM t1 WHERE id = 60;
DELETE FROM t1 WHERE id = 4;
SELECT * FROM t1;
DELETE FROM t1 WHERE id IN (40,11,35);
SELECT * FROM t1;
DELETE FROM t1 WHERE id IN (4,60,1);
SELECT msg FROM t1;
DELETE FROM t1 WHERE id IN (81,72);
SELECT id FROM t1;
DELETE FROM t1 WHERE id IN (7,10);
SELECT * FROM t1;
DELETE FROM t1 WHERE id = 8;
SELECT * FROM t1;
-- source include/not_embedded.inc
let $MYSQLD_DATADIR= `select @@datadir`;
--echo #
--echo # Testing indexed UPDATE and DELETE for all table types
--echo #
--echo # CSV table
CREATE TABLE t1 (
id INT KEY NOT NULL,
msg VARCHAR(32))
ENGINE=CONNECT TABLE_TYPE=CSV AVG_ROW_LENGTH=6;
-- source updelx.inc
ALTER TABLE t1 MAPPED=YES;
-- source updelx.inc
ALTER TABLE t1 MAPPED=NO BLOCK_SIZE=6;
-- source updelx.inc
ALTER TABLE t1 MAPPED=YES;
-- source updelx.inc
DROP TABLE t1;
--echo # DOS table
CREATE TABLE t1 (
id INT(4) KEY NOT NULL,
msg VARCHAR(16))
ENGINE=CONNECT TABLE_TYPE=DOS;
-- source updelx.inc
ALTER TABLE t1 MAPPED=YES;
-- source updelx.inc
ALTER TABLE t1 MAPPED=NO BLOCK_SIZE=4;
-- source updelx.inc
ALTER TABLE t1 MAPPED=YES;
-- source updelx.inc
DROP TABLE t1;
--echo # FIX table
CREATE TABLE t1 (
id INT(4) KEY NOT NULL,
msg VARCHAR(16) CHARSET BINARY DISTRIB=CLUSTERED)
ENGINE=CONNECT TABLE_TYPE=FIX BLOCK_SIZE=4;
-- source updelx.inc
ALTER TABLE t1 MAPPED=YES;
-- source updelx.inc
ALTER TABLE t1 MAPPED=NO HUGE=YES;
-- source updelx.inc
DROP TABLE t1;
--echo # BIN table
CREATE TABLE t1 (
id INT(4) KEY NOT NULL,
msg VARCHAR(16) CHARSET BINARY DISTRIB=CLUSTERED)
ENGINE=CONNECT TABLE_TYPE=BIN BLOCK_SIZE=8;
-- source updelx.inc
ALTER TABLE t1 MAPPED=YES;
-- source updelx.inc
ALTER TABLE t1 MAPPED=NO HUGE=YES;
-- source updelx.inc
DROP TABLE t1;
--echo # DBF table
CREATE TABLE t1 (
id INT(4) KEY NOT NULL,
msg VARCHAR(16))
ENGINE=CONNECT TABLE_TYPE=DBF BLOCK_SIZE=12;
-- source updelx.inc
ALTER TABLE t1 MAPPED=YES;
-- source updelx.inc
#ALTER TABLE t1 MAPPED=NO HUGE=YES;
#-- source updelx.inc
DROP TABLE t1;
--echo # VEC table
CREATE TABLE t1 (
id INT(4) KEY NOT NULL,
msg VARCHAR(16))
ENGINE=CONNECT TABLE_TYPE=VEC BLOCK_SIZE=6 MAX_ROWS=16;
-- source updelx.inc
ALTER TABLE t1 MAPPED=YES;
-- source updelx.inc
ALTER TABLE t1 MAPPED=NO HUGE=YES;
-- source updelx.inc
DROP TABLE t1;
--echo # Split VEC table (outward)
CREATE TABLE t1 (
id INT(4) KEY NOT NULL,
msg VARCHAR(16))
ENGINE=CONNECT TABLE_TYPE=VEC BLOCK_SIZE=6 FILE_NAME='tx.vec';
-- source updelx.inc
ALTER TABLE t1 MAPPED=YES;
-- source updelx.inc
DROP TABLE t1;
# Cleanup
--remove_file $MYSQLD_DATADIR/test/tx1.vec
--remove_file $MYSQLD_DATADIR/test/tx2.vec
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment