Debian Codegraph @

mysql-test/suite/rpl/t/rpl_gis_ddl_myisam.test

raw
1 #############################################################################
2 #
3 # The aim of this test case is to test the new column property/constraint
4 # on geometry columns which allows to specify the SRID.
5 #
6 # E.g: CREATE TABLE t1(c1 GEOMETRY SRID 4326, c2 POINT SRID 0 NOT NULL);
7 #
8 # The following scenarios are tested :
9 #
10 # 1. Test that the column with SRID property on a MyISAM table should
11 # only be supported if the SRID represents a cartesian coordinate
12 # system.
13 #
14 # Creation date: 2017-08-03
15 # Author: Pavan Naik
16 #
17 #############################################################################
18
19 # Skip the test case on group replication runs since it uses
20 # MyISAM engine tables.
21 --source include/force_myisam_default.inc
22 --source include/have_myisam.inc
23 --source include/not_group_replication_plugin.inc
24 --source include/master-slave.inc
25
26 --echo # Column with SRID property on a MyISAM table should only be
27 --echo # supported if the SRID represents a cartesian coordinate system.
28
29 --echo [Connection Master]
30 --connection master
31
32 --error ER_CHECK_NOT_IMPLEMENTED
33 CREATE TABLE t1 (col1 POINT, col2 POINT SRID 4326) ENGINE = MyISAM;
34
35 CREATE TABLE t1 (col1 POINT, col2 POINT SRID 2000) ENGINE = MyISAM;
36
37 INSERT INTO t1(col1, col2)
38 VALUES (ST_GeomFromText('POINT(0 0)'),
39 ST_GeomFromText('POINT(0 0)', 2000));
40
41 INSERT INTO t1(col1, col2)
42 VALUES (ST_GeomFromText('POINT(1 1)', 2000),
43 ST_GeomFromText('POINT(1 1)', 2000));
44
45 --source include/sync_slave_sql_with_master.inc
46 --echo [Connection Slave]
47
48 --let $diff_tables = master:t1, slave:t1
49 --source include/diff_tables.inc
50
51 SELECT * FROM INFORMATION_SCHEMA.ST_GEOMETRY_COLUMNS;
52
53 SELECT ST_SRID(col1) AS no_srid, ST_SRID(col2) AS srid_2000 FROM t1;
54
55 --echo [Connection Master]
56 --connection master
57
58 DELETE FROM t1;
59
60 ALTER TABLE t1 CHANGE COLUMN col1 col1 POINT SRID 2000;
61 ALTER TABLE t1 CHANGE COLUMN col2 col2 POINT SRID 0;
62
63 INSERT INTO t1(col1, col2)
64 VALUES (ST_GeomFromText('POINT(0 0)', 2000),
65 ST_GeomFromText('POINT(0 0)', 0));
66
67 INSERT INTO t1(col1, col2)
68 VALUES (ST_GeomFromText('POINT(1 1)', 2000),
69 ST_GeomFromText('POINT(1 1)', 0));
70
71 SELECT * FROM INFORMATION_SCHEMA.ST_GEOMETRY_COLUMNS;
72
73 --source include/sync_slave_sql_with_master.inc
74 --echo [Connection Slave]
75
76 --let $diff_tables = master:t1, slave:t1
77 --source include/diff_tables.inc
78
79 SELECT * FROM INFORMATION_SCHEMA.ST_GEOMETRY_COLUMNS;
80
81 SELECT ST_SRID(col1) AS srid_2000, ST_SRID(col2) AS srid_0 FROM t1;
82
83 --echo [Connection Master]
84 --connection master
85
86 --echo # Cleanup
87 DROP TABLE t1;
88
89 --source include/sync_slave_sql_with_master.inc
90
91 --source include/rpl_end.inc