Commit 1773116f authored by Marko Mäkelä's avatar Marko Mäkelä

Use ST_AsText() to get textual result

parent 84ee7a10
......@@ -56,7 +56,7 @@ eval CREATE TABLE t1
SPATIAL INDEX(c3)) $engine;
INSERT INTO t1 (id, c2) values(1,1);
SELECT * FROM t1;
SELECT id,c2,ST_AsText(c3) c3 FROM t1;
--enable_info
ALTER TABLE t1 ADD COLUMN (
......@@ -68,7 +68,7 @@ ALTER TABLE t1 ADD INDEX(d3);
BEGIN;
UPDATE t1 SET d3='';
ROLLBACK;
SELECT * FROM t1;
SELECT id,c2,ST_AsText(c3) c3, d1, d2, d3, d4 FROM t1;
INSERT INTO t1 (id) VALUES(2),(3),(4),(5),(6);
--enable_info
......@@ -80,7 +80,7 @@ CHANGE d4 dfour TIMESTAMP NOT NULL DEFAULT now();
UPDATE t1 SET d3='foo' WHERE id = 2;
UPDATE t1 SET d3=DEFAULT WHERE id = 4;
INSERT INTO t1 SET id = 7;
SELECT * FROM t1;
SELECT id,c2,ST_AsText(c3) c3, d1, d2, d3, dfour FROM t1;
CHECK TABLE t1;
# add virtual columns
......@@ -106,9 +106,9 @@ UPDATE t1 SET d3 = 'xxxxx' WHERE id = 2;
# transaction rollback
BEGIN;
UPDATE t1 SET d3 = 'xxxxx' WHERE id = 3;
SELECT * FROM t1 WHERE id = 3;
SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 3;
ROLLBACK;
SELECT * FROM t1 WHERE id = 3;
SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 3;
# NULL to NULL, no change
BEGIN;
......@@ -116,9 +116,9 @@ UPDATE t1 SET d7 = NULL WHERE ID = 5;
ROLLBACK;
BEGIN;
UPDATE t1 SET d7 = NULL, d6 = 10 WHERE id = 5;
SELECT * FROM t1 WHERE id = 5;
SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 5;
ROLLBACK;
SELECT * FROM t1 WHERE id = 5;
SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7 FROM t1 WHERE id = 5;
# add virtual stored columns; not instant
--enable_info
......@@ -128,7 +128,7 @@ ALTER TABLE t1 ADD COLUMN (f1 VARCHAR(20) AS (concat('x', e2)) STORED);
ALTER TABLE t1 ADD COLUMN (d8 VARCHAR(20) DEFAULT 'omnopq');
--disable_info
SELECT * FROM t1;
SELECT id, c2, ST_AsText(c3) c3, d1, d2, d3, dfour, e1, e2, e3, d5, d6, d7, f1, d8 FROM t1;
SHOW CREATE TABLE t1;
--enable_info
......@@ -160,7 +160,7 @@ COMMIT;
--enable_info
ALTER TABLE t2 ADD COLUMN d1 VARCHAR(2000) DEFAULT REPEAT('asdf',500);
--disable_info
SELECT * FROM t2;
SELECT id, c1, ST_AsText(p) p, d1 FROM t2;
# inplace update, rollback
BEGIN;
......@@ -206,17 +206,17 @@ eval CREATE TABLE t3
SPATIAL INDEX(c3))
$engine;
INSERT INTO t3(id,c2) VALUES(1,1),(2,2),(3,3);
SELECT * FROM t3;
SELECT id, c2, ST_AsText(c3) c3 FROM t3;
--enable_info
ALTER TABLE t3 ADD COLUMN
(c4 DATETIME DEFAULT current_timestamp(),
c5 TIMESTAMP NOT NULL DEFAULT current_timestamp(),
c6 POINT);
SELECT * FROM t3;
SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6 FROM t3;
ALTER TABLE t3 ADD COLUMN c7 TIME NOT NULL DEFAULT current_timestamp();
ALTER TABLE t3 ADD COLUMN c8 DATE NOT NULL DEFAULT current_timestamp();
--disable_info
SELECT * FROM t3;
SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8 FROM t3;
--enable_info
ALTER TABLE t3 ADD COLUMN t TEXT CHARSET utf8
......@@ -230,7 +230,7 @@ ALTER TABLE t3 CHANGE t phrase TEXT DEFAULT 0xc3a4c3a448,
CHANGE b b BLOB NOT NULL DEFAULT 'binary line of business';
--disable_info
INSERT INTO t3 SET id=5, c2=9;
SELECT * FROM t3;
SELECT id, c2, ST_AsText(c3) c3, c4, c5, c6, c7, c8, phrase, b FROM t3;
--enable_info
ALTER TABLE t3 DROP c3, DROP c7;
--disable_info
......
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