mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
Adding more tests for "MDEV-7563 Support CHECK constraint":
- real functions - temporal functions - hybrid functions
This commit is contained in:
committed by
Sergei Golubchik
parent
d99994a460
commit
11debf698f
@ -1829,3 +1829,36 @@ t2 CREATE TABLE `t2` (
|
||||
`w2` int(1) DEFAULT NULL
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
DROP TABLE t1,t2;
|
||||
#
|
||||
# Start of 10.2 tests
|
||||
#
|
||||
#
|
||||
# MDEV-7563 Support CHECK constraint
|
||||
#
|
||||
CREATE TABLE t1 (a POINT, x DOUBLE DEFAULT x(a), y DOUBLE DEFAULT y(a));
|
||||
INSERT INTO t1 (a) VALUES (Point(1,2));
|
||||
SELECT x,y FROM t1;
|
||||
x y
|
||||
1 2
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (g GEOMETRY, area DOUBLE DEFAULT ST_AREA(g));
|
||||
INSERT INTO t1 (g) VALUES (GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))'));
|
||||
SELECT area FROM t1;
|
||||
area
|
||||
400
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (g GEOMETRY, length DOUBLE DEFAULT ST_LENGTH(g));
|
||||
INSERT INTO t1 (g) VALUES (GeomFromText('LINESTRING(0 0,20 0,20 20,0 20,0 0)'));
|
||||
SELECT length FROM t1;
|
||||
length
|
||||
80
|
||||
DROP TABLE t1;
|
||||
CREATE TABLE t1 (g POINT, distance DOUBLE DEFAULT ST_DISTANCE(g, POINT(0,0)));
|
||||
INSERT INTO t1 (g) VALUES (Point(1,0));
|
||||
SELECT distance FROM t1;
|
||||
distance
|
||||
1
|
||||
DROP TABLE t1;
|
||||
#
|
||||
# End of 10.2 tests
|
||||
#
|
||||
|
Reference in New Issue
Block a user