-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable GEOMETRY data types using blob storage. #29
- Loading branch information
Showing
4 changed files
with
472 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,336 @@ | ||
# | ||
# The purpose of this test is to build a table of each supported data type | ||
# | ||
# INTEGER | ||
CREATE TABLE t1 ( | ||
column1 integer | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (1); | ||
select * FROM t1; | ||
column1 | ||
1 | ||
DROP TABLE t1; | ||
# DOUBLE | ||
CREATE TABLE t1 ( | ||
column1 double | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (1.1); | ||
select * FROM t1; | ||
column1 | ||
1.1 | ||
DROP TABLE t1; | ||
# DECIMAL | ||
CREATE TABLE t1 ( | ||
column1 decimal(10,3) | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (1.1); | ||
select * FROM t1; | ||
column1 | ||
1.100 | ||
DROP TABLE t1; | ||
# FLOAT | ||
CREATE TABLE t1 ( | ||
column1 float | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (1.1); | ||
select * FROM t1; | ||
column1 | ||
1.1 | ||
DROP TABLE t1; | ||
# TINYINT | ||
CREATE TABLE t1 ( | ||
column1 tinyint | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (1); | ||
select * FROM t1; | ||
column1 | ||
1 | ||
DROP TABLE t1; | ||
# BOOL | ||
CREATE TABLE t1 ( | ||
column1 bool | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (1); | ||
select * FROM t1; | ||
column1 | ||
1 | ||
DROP TABLE t1; | ||
# SMALLINT | ||
CREATE TABLE t1 ( | ||
column1 smallint | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (1); | ||
select * FROM t1; | ||
column1 | ||
1 | ||
DROP TABLE t1; | ||
# MEDIUMINT | ||
CREATE TABLE t1 ( | ||
column1 mediumint | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (1); | ||
select * FROM t1; | ||
column1 | ||
1 | ||
DROP TABLE t1; | ||
# BIGINT | ||
CREATE TABLE t1 ( | ||
column1 bigint | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (1); | ||
select * FROM t1; | ||
column1 | ||
1 | ||
DROP TABLE t1; | ||
# YEAR | ||
CREATE TABLE t1 ( | ||
column1 year | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (2017); | ||
select * FROM t1; | ||
column1 | ||
2017 | ||
DROP TABLE t1; | ||
# BIT | ||
CREATE TABLE t1 ( | ||
column1 bit | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (1); | ||
select column1+0 FROM t1; | ||
column1+0 | ||
1 | ||
DROP TABLE t1; | ||
# CHAR | ||
CREATE TABLE t1 ( | ||
column1 char | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("t"); | ||
select * FROM t1; | ||
column1 | ||
t | ||
DROP TABLE t1; | ||
# VARCHAR | ||
CREATE TABLE t1 ( | ||
column1 varchar(255) | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("test"); | ||
select * FROM t1; | ||
column1 | ||
test | ||
DROP TABLE t1; | ||
# BINARY | ||
CREATE TABLE t1 ( | ||
column1 binary | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("t"); | ||
select * FROM t1; | ||
column1 | ||
t | ||
DROP TABLE t1; | ||
# ENUM | ||
CREATE TABLE t1 ( | ||
column1 enum('test') | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("test"); | ||
select * FROM t1; | ||
column1 | ||
test | ||
DROP TABLE t1; | ||
# DATETIME | ||
CREATE TABLE t1 ( | ||
column1 DATETIME | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("2017-08-13 00:00:00"); | ||
select * FROM t1; | ||
column1 | ||
2017-08-13 00:00:00 | ||
DROP TABLE t1; | ||
# DATETIME(6) | ||
CREATE TABLE t1 ( | ||
column1 DATETIME(6) | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("2017-08-13 00:00:00.000000"); | ||
select * FROM t1; | ||
column1 | ||
2017-08-13 00:00:00.000000 | ||
DROP TABLE t1; | ||
# TIME | ||
CREATE TABLE t1 ( | ||
column1 TIME | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("00:00:00"); | ||
select * FROM t1; | ||
column1 | ||
00:00:00 | ||
DROP TABLE t1; | ||
# TIME(6) | ||
CREATE TABLE t1 ( | ||
column1 TIME(6) | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("00:00:00.000000"); | ||
select * FROM t1; | ||
column1 | ||
00:00:00.000000 | ||
DROP TABLE t1; | ||
# TIMESTAMP | ||
CREATE TABLE t1 ( | ||
column1 TIMESTAMP | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("2017-08-13 00:00:00"); | ||
select * FROM t1; | ||
column1 | ||
2017-08-13 00:00:00 | ||
DROP TABLE t1; | ||
# TIMESTAMP(6) | ||
CREATE TABLE t1 ( | ||
column1 TIMESTAMP(6) | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("2017-08-13 00:00:00.000000"); | ||
select * FROM t1; | ||
column1 | ||
2017-08-13 00:00:00.000000 | ||
DROP TABLE t1; | ||
# TINYTEXT | ||
CREATE TABLE t1 ( | ||
column1 TINYTEXT | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("test"); | ||
select * FROM t1; | ||
column1 | ||
test | ||
DROP TABLE t1; | ||
# TEXT | ||
CREATE TABLE t1 ( | ||
column1 TEXT | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("test"); | ||
select * FROM t1; | ||
column1 | ||
test | ||
DROP TABLE t1; | ||
# MEDIUMTEXT | ||
CREATE TABLE t1 ( | ||
column1 MEDIUMTEXT | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("test"); | ||
select * FROM t1; | ||
column1 | ||
test | ||
DROP TABLE t1; | ||
# LONGTEXT | ||
CREATE TABLE t1 ( | ||
column1 LONGTEXT | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ("test"); | ||
select * FROM t1; | ||
column1 | ||
test | ||
DROP TABLE t1; | ||
# TINYBLOB | ||
CREATE TABLE t1 ( | ||
column1 TINYBLOB | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ('aHR0cHM6Ly9naXRodWIuY29tL1NoZWxudXR0Mi9jcnVuY2g='); | ||
select * FROM t1; | ||
column1 | ||
aHR0cHM6Ly9naXRodWIuY29tL1NoZWxudXR0Mi9jcnVuY2g= | ||
DROP TABLE t1; | ||
# BLOB | ||
CREATE TABLE t1 ( | ||
column1 BLOB | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ('aHR0cHM6Ly9naXRodWIuY29tL1NoZWxudXR0Mi9jcnVuY2g='); | ||
select * FROM t1; | ||
column1 | ||
aHR0cHM6Ly9naXRodWIuY29tL1NoZWxudXR0Mi9jcnVuY2g= | ||
DROP TABLE t1; | ||
# MEDIUMBLOB | ||
CREATE TABLE t1 ( | ||
column1 MEDIUMBLOB | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ('aHR0cHM6Ly9naXRodWIuY29tL1NoZWxudXR0Mi9jcnVuY2g='); | ||
select * FROM t1; | ||
column1 | ||
aHR0cHM6Ly9naXRodWIuY29tL1NoZWxudXR0Mi9jcnVuY2g= | ||
DROP TABLE t1; | ||
# LONGBLOB | ||
CREATE TABLE t1 ( | ||
column1 LONGBLOB | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES ('aHR0cHM6Ly9naXRodWIuY29tL1NoZWxudXR0Mi9jcnVuY2g='); | ||
select * FROM t1; | ||
column1 | ||
aHR0cHM6Ly9naXRodWIuY29tL1NoZWxudXR0Mi9jcnVuY2g= | ||
DROP TABLE t1; | ||
# POINT | ||
CREATE TABLE t1 ( | ||
column1 POINT | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (PointFromText('POINT(10 10)')); | ||
select ST_AsText(column1) FROM t1; | ||
ST_AsText(column1) | ||
POINT(10 10) | ||
DROP TABLE t1; | ||
# LINESTRING | ||
CREATE TABLE t1 ( | ||
column1 LINESTRING | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (LineFromText('LINESTRING(0 0,0 10,10 0)')); | ||
select ST_AsText(column1) FROM t1; | ||
ST_AsText(column1) | ||
LINESTRING(0 0,0 10,10 0) | ||
DROP TABLE t1; | ||
# POLYGON | ||
CREATE TABLE t1 ( | ||
column1 POLYGON | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (PolygonFromText('POLYGON((10 10,20 10,20 20,10 20,10 10))')); | ||
select ST_AsText(column1) FROM t1; | ||
ST_AsText(column1) | ||
POLYGON((10 10,20 10,20 20,10 20,10 10)) | ||
DROP TABLE t1; | ||
# MULTIPOINT | ||
CREATE TABLE t1 ( | ||
column1 MULTIPOINT | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (MultiPointFromText('MULTIPOINT(0 0,10 10,10 20,20 20)')); | ||
select ST_AsText(column1) FROM t1; | ||
ST_AsText(column1) | ||
MULTIPOINT(0 0,10 10,10 20,20 20) | ||
DROP TABLE t1; | ||
# MULTILINESTRING | ||
CREATE TABLE t1 ( | ||
column1 MULTILINESTRING | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (MultiLineStringFromText('MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48))')); | ||
select ST_AsText(column1) FROM t1; | ||
ST_AsText(column1) | ||
MULTILINESTRING((10 48,10 21,10 0),(16 0,16 23,16 48)) | ||
DROP TABLE t1; | ||
# MULTIPOLYGON | ||
CREATE TABLE t1 ( | ||
column1 MULTIPOLYGON | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (MultiPolygonFromText('MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18)))')); | ||
select ST_AsText(column1) FROM t1; | ||
ST_AsText(column1) | ||
MULTIPOLYGON(((28 26,28 0,84 0,84 42,28 26),(52 18,66 23,73 9,48 6,52 18)),((59 18,67 18,67 13,59 13,59 18))) | ||
DROP TABLE t1; | ||
# GEOMETRYCOLLECTION | ||
CREATE TABLE t1 ( | ||
column1 GEOMETRYCOLLECTION | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (GeomCollFromText('GEOMETRYCOLLECTION(POINT(0 0), LINESTRING(0 0,10 10))')); | ||
select ST_AsText(column1) FROM t1; | ||
ST_AsText(column1) | ||
GEOMETRYCOLLECTION(POINT(0 0),LINESTRING(0 0,10 10)) | ||
DROP TABLE t1; | ||
# GEOMETRY | ||
CREATE TABLE t1 ( | ||
column1 GEOMETRY | ||
) ENGINE=crunch; | ||
INSERT INTO t1 VALUES (PointFromText('POINT(10 10)')); | ||
select ST_AsText(column1) FROM t1; | ||
ST_AsText(column1) | ||
POINT(10 10) | ||
DROP TABLE t1; |
Oops, something went wrong.