Commit 4dcbb775 authored by Alexander Barkov's avatar Alexander Barkov Committed by Sergei Golubchik

parentheses in default

- Adding SHOW CREATE TABLE into all DEFAULT tests,
  to cover need_parentheses_in_default() for all items
- Fixing a few items not to print parentheses in DEFAULT:
  spatial function-alike predicates, IS_IPV4 and IS_IPV6 functions,
  COLUMN_CHECK() and COLUMN_EXISTS().
parent b3e11d33
......@@ -3309,6 +3309,13 @@ a VARCHAR(10),
mn VARCHAR(10) DEFAULT LIKE_RANGE_MIN(a,10),
mx VARCHAR(10) DEFAULT LIKE_RANGE_MAX(a,10)
);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
`mn` varchar(10) DEFAULT LIKE_RANGE_MIN(a,10),
`mx` varchar(10) DEFAULT LIKE_RANGE_MAX(a,10)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES ('a'),('a_'),('a%');
SELECT a, HEX(mn), HEX(mx) FROM t1;
a HEX(mn) HEX(mx)
......
This diff is collapsed.
......@@ -1895,6 +1895,22 @@ dyncol2_check INT DEFAULT COLUMN_CHECK(dyncol2),
dyncol1_list TEXT DEFAULT COLUMN_LIST(dyncol1),
dyncol1_json TEXT DEFAULT COLUMN_JSON(dyncol1)
);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`name` varchar(10) DEFAULT NULL,
`value` varchar(10) DEFAULT NULL,
`dyncol0` blob DEFAULT COLUMN_CREATE(name, value),
`value_dyncol0_name0` varchar(10) DEFAULT (COLUMN_GET(dyncol0, 'name0' AS CHAR)),
`dyncol1` blob DEFAULT COLUMN_ADD(dyncol0, 'name1', 'value1'),
`value_dyncol1_name1` varchar(10) DEFAULT (COLUMN_GET(dyncol1, 'name1' AS CHAR)),
`dyncol2` blob DEFAULT COLUMN_DELETE(dyncol1, 'name1'),
`dyncol2_exists_name0` int(11) DEFAULT COLUMN_EXISTS(dyncol2, 'name0'),
`dyncol2_exists_name1` int(11) DEFAULT COLUMN_EXISTS(dyncol2, 'name1'),
`dyncol2_check` int(11) DEFAULT COLUMN_CHECK(dyncol2),
`dyncol1_list` text DEFAULT COLUMN_LIST(dyncol1),
`dyncol1_json` text DEFAULT COLUMN_JSON(dyncol1)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (name,value) VALUES ('name0', 'value0');
SELECT value_dyncol0_name0, value_dyncol1_name1 FROM t1;
value_dyncol0_name0 value_dyncol1_name1
......
......@@ -174,6 +174,14 @@ set global max_allowed_packet=default;
# MDEV-10134 Add full support for DEFAULT
#
CREATE TABLE t1 (a TEXT, b BLOB DEFAULT COMPRESS(a), bl INT DEFAULT UNCOMPRESSED_LENGTH(b), a1 TEXT DEFAULT UNCOMPRESS(b));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` text DEFAULT NULL,
`b` blob DEFAULT COMPRESS(a),
`bl` int(11) DEFAULT UNCOMPRESSED_LENGTH(b),
`a1` text DEFAULT UNCOMPRESS(b)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (REPEAT('a',100));
SELECT bl, a1 FROM t1;
bl a1
......
......@@ -1437,6 +1437,13 @@ a VARCHAR(30),
b TEXT DEFAULT SHA(a),
c TEXT DEFAULT SHA2(a,224)
);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT NULL,
`b` text DEFAULT SHA(a),
`c` text DEFAULT SHA2(a,224)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES ('abc');
SELECT * FROM t1;
a b c
......
......@@ -219,6 +219,13 @@ a VARCHAR(30),
b BLOB DEFAULT DES_ENCRYPT(a, 'passwd'),
c TEXT DEFAULT DES_DECRYPT(b, 'passwd')
);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT NULL,
`b` blob DEFAULT DES_ENCRYPT(a, 'passwd'),
`c` text DEFAULT DES_DECRYPT(b, 'passwd')
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES ('test');
SELECT c FROM t1;
c
......
......@@ -1446,6 +1446,15 @@ a1 VARCHAR(30) DEFAULT INET_NTOA(b),
c INT DEFAULT IS_IPV4(a),
d INT DEFAULT IS_IPV6(a)
);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT NULL,
`b` bigint(20) DEFAULT INET_ATON(a),
`a1` varchar(30) DEFAULT INET_NTOA(b),
`c` int(11) DEFAULT IS_IPV4(a),
`d` int(11) DEFAULT IS_IPV6(a)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES ('192.168.001.001'),('::1'),('xxx');
SELECT * FROM t1;
a b a1 c d
......@@ -1460,6 +1469,15 @@ str1 VARCHAR(128) DEFAULT INET6_NTOA(addr),
b INT DEFAULT IS_IPV4_COMPAT(addr),
c INT DEFAULT IS_IPV4_MAPPED(addr)
);
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`str` varchar(128) DEFAULT NULL,
`addr` varbinary(16) DEFAULT INET6_ATON(str),
`str1` varchar(128) DEFAULT INET6_NTOA(addr),
`b` int(11) DEFAULT IS_IPV4_COMPAT(addr),
`c` int(11) DEFAULT IS_IPV4_MAPPED(addr)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (str) VALUES ('::FFFF:192.168.0.1'),('::10.0.5.9');
SELECT str, str1, b,c FROM t1;
str str1 b c
......
......@@ -151,6 +151,12 @@ DROP TABLE t1;
# MDEV-10134 Add full support for DEFAULT
#
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1, b VARBINARY(10) DEFAULT WEIGHT_STRING(a AS CHAR(10)));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
`b` varbinary(10) DEFAULT WEIGHT_STRING(a AS CHAR(10))
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES ('a');
SELECT a, HEX(b) FROM t1;
a HEX(b)
......
This diff is collapsed.
......@@ -2672,6 +2672,11 @@ set GLOBAL sql_mode=default;
# MDEV-10134 Add full support for DEFAULT
#
CREATE TABLE t1 (a VARCHAR(30) DEFAULT USER());
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(30) DEFAULT USER()
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 VALUES ();
GRANT ALL PRIVILEGES ON test.* TO dummy@localhost IDENTIFIED BY 'pwd';
connect conn1,localhost,dummy,pwd,test;
......
......@@ -1684,6 +1684,12 @@ set use_stat_tables=@save_use_stat_tables;
# MDEV-10134 Add full support for DEFAULT
#
CREATE TABLE t1 (a BLOB, b TEXT DEFAULT DECODE_HISTOGRAM('SINGLE_PREC_HB',a));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` blob DEFAULT NULL,
`b` text DEFAULT DECODE_HISTOGRAM('SINGLE_PREC_HB',a)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES (0x0000000000000000000000000101010101010101010202020303030304040404050505050606070707080809090A0A0B0C0D0D0E0E0F10111213131415161718191B1C1E202224292A2E33373B4850575F6A76818C9AA7B9C4CFDADFE5EBF0F4F8FAFCFF);
SELECT b FROM t1;
b
......
......@@ -453,6 +453,12 @@ SELECT METAPHON('Hello');
METAPHON('Hello')
HL
CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT METAPHON(a));
SHOW CREATE TABLE t1;
Table Create Table
t1 CREATE TABLE `t1` (
`a` varchar(10) DEFAULT NULL,
`b` varchar(10) DEFAULT METAPHON(a)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
INSERT INTO t1 (a) VALUES ('Hello');
SELECT * FROM t1;
a b
......
......@@ -130,6 +130,7 @@ CREATE TABLE t1 (
mn VARCHAR(10) DEFAULT LIKE_RANGE_MIN(a,10),
mx VARCHAR(10) DEFAULT LIKE_RANGE_MAX(a,10)
);
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES ('a'),('a_'),('a%');
SELECT a, HEX(mn), HEX(mx) FROM t1;
DROP TABLE t1;
......
This diff is collapsed.
......@@ -945,6 +945,7 @@ CREATE TABLE t1 (
dyncol1_list TEXT DEFAULT COLUMN_LIST(dyncol1),
dyncol1_json TEXT DEFAULT COLUMN_JSON(dyncol1)
);
SHOW CREATE TABLE t1;
INSERT INTO t1 (name,value) VALUES ('name0', 'value0');
SELECT value_dyncol0_name0, value_dyncol1_name1 FROM t1;
SELECT dyncol2_check, dyncol2_exists_name0, dyncol2_exists_name1 FROM t1;
......
......@@ -161,6 +161,7 @@ set global max_allowed_packet=default;
--echo # MDEV-10134 Add full support for DEFAULT
--echo #
CREATE TABLE t1 (a TEXT, b BLOB DEFAULT COMPRESS(a), bl INT DEFAULT UNCOMPRESSED_LENGTH(b), a1 TEXT DEFAULT UNCOMPRESS(b));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (REPEAT('a',100));
SELECT bl, a1 FROM t1;
DROP TABLE t1;
......
......@@ -507,6 +507,7 @@ CREATE TABLE t1 (
b TEXT DEFAULT SHA(a),
c TEXT DEFAULT SHA2(a,224)
);
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES ('abc');
SELECT * FROM t1;
DROP TABLE t1;
......
......@@ -135,6 +135,7 @@ CREATE TABLE t1 (
b BLOB DEFAULT DES_ENCRYPT(a, 'passwd'),
c TEXT DEFAULT DES_DECRYPT(b, 'passwd')
);
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES ('test');
SELECT c FROM t1;
DROP TABLE t1;
......
......@@ -1097,6 +1097,7 @@ CREATE TABLE t1 (
c INT DEFAULT IS_IPV4(a),
d INT DEFAULT IS_IPV6(a)
);
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES ('192.168.001.001'),('::1'),('xxx');
SELECT * FROM t1;
DROP TABLE t1;
......@@ -1108,6 +1109,7 @@ CREATE TABLE t1 (
b INT DEFAULT IS_IPV4_COMPAT(addr),
c INT DEFAULT IS_IPV4_MAPPED(addr)
);
SHOW CREATE TABLE t1;
INSERT INTO t1 (str) VALUES ('::FFFF:192.168.0.1'),('::10.0.5.9');
SELECT str, str1, b,c FROM t1;
DROP TABLE t1;
......
......@@ -156,6 +156,7 @@ DROP TABLE t1;
--echo # MDEV-10134 Add full support for DEFAULT
--echo #
CREATE TABLE t1 (a VARCHAR(10) CHARACTER SET latin1, b VARBINARY(10) DEFAULT WEIGHT_STRING(a AS CHAR(10)));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES ('a');
SELECT a, HEX(b) FROM t1;
DROP TABLE t1;
......
......@@ -1531,150 +1531,179 @@ DROP TABLE t1,t2;
--echo #
--echo #
--echo # MDEV-7563 Support CHECK constraint
--echo # MDEV-10134 Add full support for DEFAULT
--echo #
CREATE TABLE t1 (a POINT, x DOUBLE DEFAULT x(a), y DOUBLE DEFAULT y(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (Point(1,2));
SELECT x,y FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (g GEOMETRY, area DOUBLE DEFAULT ST_AREA(g));
SHOW CREATE TABLE t1;
INSERT INTO t1 (g) VALUES (GeomFromText('POLYGON((0 0,20 0,20 20,0 20,0 0))'));
SELECT area FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (g GEOMETRY, length DOUBLE DEFAULT ST_LENGTH(g));
SHOW CREATE TABLE t1;
INSERT INTO t1 (g) VALUES (GeomFromText('LINESTRING(0 0,20 0,20 20,0 20,0 0)'));
SELECT length FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (g POINT, distance DOUBLE DEFAULT ST_DISTANCE(g, POINT(0,0)));
SHOW CREATE TABLE t1;
INSERT INTO t1 (g) VALUES (Point(1,0));
SELECT distance FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a TEXT, g GEOMETRY DEFAULT GeomFromText(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES ('point(1 1)');
SELECT AsText(g) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (x INT, y INT, g GEOMETRY DEFAULT POINT(x,y));
SHOW CREATE TABLE t1;
INSERT INTO t1 (x,y) VALUES (10,20);
SELECT AsText(g) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT PointN(a,2));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,2 2,3 3)'));
SELECT AsText(b) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT StartPoint(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,2 2,3 3)'));
SELECT AsText(b) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c GEOMETRY DEFAULT GeometryCollection(a,b));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a,b) VALUES (Point(1,1), Point(2,2));
SELECT AsText(c) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT GeomFromWKB(AsBinary(a),20));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (GeomFromText('POINT(1 1)', 10));
SELECT AsText(a), SRID(a), AsText(b), SRID(b) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT BOUNDARY(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'));
SELECT AsText(b) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT BUFFER(a,10));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'));
SELECT GeometryType(b) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT CENTROID(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'));
SELECT AsText(b) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT ENVELOPE(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(1 1,4 4)'));
SELECT AsText(b) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT PointOnSurface(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (GeomFromText('POLYGON((10 10, 10 20, 20 20, 20 10, 10 10))'));
SELECT GeometryType(b) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY DEFAULT Point(1,1), c GEOMETRY DEFAULT ST_UNION(a,b));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (Point(0,0));
SELECT AsText(c) FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b VARCHAR(20) DEFAULT GeometryType(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (Point(0, 0));
SELECT b FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsSimple(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (Point(0, 0));
SELECT b FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsEmpty(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (Point(0, 0));
SELECT b FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsRing(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(0 0,0 1,1 1,1 0,0 0)'));
SELECT b FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT IsClosed(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (GeomFromText('LineString(0 0,0 1,1 1,1 0,0 0)'));
SELECT b FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT Dimension(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (Buffer(Point(1,1),1));
SELECT b FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT NumGeometries(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (ST_UNION(Point(1,1),Point(0,0)));
SELECT b FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT NumInteriorRings(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (GeomFromText('Polygon((0 0,0 3,3 3,3 0,0 0),(1 1,1 2,2 2,2 1,1 1))'));
SELECT b FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT NumPoints(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (LineString(Point(1,1),Point(0,0)));
SELECT b FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b INT DEFAULT SRID(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (GeomFromText('Point(1 1)', 100));
SELECT b FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c INT DEFAULT MBRDisjoint(a,b));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1));
SELECT c FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c INT DEFAULT ST_Disjoint(a,b));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1));
SELECT c FROM t1;
DROP TABLE t1;
CREATE TABLE t1 (a GEOMETRY, b GEOMETRY, c INT DEFAULT ST_Relate(a,b,'T*F**FFF*'));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a,b) VALUES (Point(1,1),Point(1,1));
SELECT c FROM t1;
DROP TABLE t1;
......
......@@ -2183,6 +2183,7 @@ set GLOBAL sql_mode=default;
CREATE TABLE t1 (a VARCHAR(30) DEFAULT USER());
SHOW CREATE TABLE t1;
INSERT INTO t1 VALUES ();
GRANT ALL PRIVILEGES ON test.* TO dummy@localhost IDENTIFIED BY 'pwd';
connect (conn1,localhost,dummy,pwd,test);
......
......@@ -751,6 +751,7 @@ set use_stat_tables=@save_use_stat_tables;
--echo #
CREATE TABLE t1 (a BLOB, b TEXT DEFAULT DECODE_HISTOGRAM('SINGLE_PREC_HB',a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES (0x0000000000000000000000000101010101010101010202020303030304040404050505050606070707080809090A0A0B0C0D0D0E0E0F10111213131415161718191B1C1E202224292A2E33373B4850575F6A76818C9AA7B9C4CFDADFE5EBF0F4F8FAFCFF);
SELECT b FROM t1;
DROP TABLE t1;
......
......@@ -520,6 +520,7 @@ DROP TABLE t1;
eval CREATE FUNCTION metaphon RETURNS STRING SONAME "$UDF_EXAMPLE_SO";
SELECT METAPHON('Hello');
CREATE TABLE t1 (a VARCHAR(10), b VARCHAR(10) DEFAULT METAPHON(a));
SHOW CREATE TABLE t1;
INSERT INTO t1 (a) VALUES ('Hello');
SELECT * FROM t1;
DROP FUNCTION METAPHON;
......
......@@ -2422,6 +2422,7 @@ class Item_func_dyncol_check :public Item_bool_func
Item_func_dyncol_check(THD *thd, Item *str): Item_bool_func(thd, str) {}
longlong val_int();
const char *func_name() const { return "column_check"; }
bool need_parentheses_in_default() { return false; }
};
class Item_func_dyncol_exists :public Item_bool_func
......@@ -2431,6 +2432,7 @@ class Item_func_dyncol_exists :public Item_bool_func
Item_bool_func(thd, str, num) {}
longlong val_int();
const char *func_name() const { return "column_exists"; }
bool need_parentheses_in_default() { return false; }
};
inline bool is_cond_or(Item *item)
......
......@@ -299,6 +299,7 @@ class Item_func_spatial_rel: public Item_bool_func2_with_rev
return add_key_fields_optimize_op(join, key_fields, and_level,
usable_tables, sargables, false);
}
bool need_parentheses_in_default() { return false; }
};
......@@ -339,6 +340,7 @@ class Item_func_spatial_relate: public Item_bool_func
{ }
longlong val_int();
const char *func_name() const { return "st_relate"; }
bool need_parentheses_in_default() { return false; }
};
......@@ -429,6 +431,7 @@ class Item_func_isempty: public Item_bool_func
longlong val_int();
const char *func_name() const { return "st_isempty"; }
void fix_length_and_dec() { maybe_null= 1; }
bool need_parentheses_in_default() { return false; }
};
class Item_func_issimple: public Item_int_func
......
......@@ -76,6 +76,7 @@ class Item_func_inet_bool_base : public Item_bool_func
public:
virtual longlong val_int();
bool need_parentheses_in_default() { return false; }
protected:
virtual bool calc_value(const String *arg) = 0;
......
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