mariadb/mysql-test/r/fulltext_distinct.result
unknown 20c2ddaf0c Bug #19498: Inconsistent support for DEFAULT in TEXT columns
When a default of '' was specified for TEXT/BLOB columns, the specification
  was silently ignored. This is presumably to be nice to applications (or
  people) who generate their column definitions in a not-very-clever fashion.

  For clarity, doing this now results in a warning, or an error in strict
  mode.


mysql-test/r/federated.result:
  Update results
mysql-test/r/fulltext_distinct.result:
  Update results
mysql-test/r/fulltext_update.result:
  Update results
mysql-test/r/gis-rtree.result:
  Update results
mysql-test/r/gis.result:
  Update results
mysql-test/r/join_outer.result:
  Update results
mysql-test/r/order_by.result:
  Update results
mysql-test/r/type_blob.result:
  Add new results
mysql-test/r/type_ranges.result:
  Update results
mysql-test/t/type_blob.test:
  Add new test
sql/field.cc:
  Issue a warning when setting '' as the default on a BLOB/TEXT column,
  and make it an error in strict mode. Also, clarify comments about when
  NO_DEFAULT_VALUE_FLAG is set.
2006-07-18 16:04:18 -07:00

45 lines
1.2 KiB
Text

DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (
id mediumint unsigned NOT NULL auto_increment,
tag char(6) NOT NULL default '',
value text NOT NULL default '',
PRIMARY KEY (id),
KEY kt(tag),
KEY kv(value(15)),
FULLTEXT KEY kvf(value)
) ENGINE=MyISAM;
Warnings:
Warning 1101 BLOB/TEXT column 'value' can't have a default value
CREATE TABLE t2 (
id_t2 mediumint unsigned NOT NULL default '0',
id_t1 mediumint unsigned NOT NULL default '0',
field_number tinyint unsigned NOT NULL default '0',
PRIMARY KEY (id_t2,id_t1,field_number),
KEY id_t1(id_t1)
) ENGINE=MyISAM;
INSERT INTO t1 (tag,value) VALUES ('foo123','bar111');
INSERT INTO t1 (tag,value) VALUES ('foo123','bar222');
INSERT INTO t1 (tag,value) VALUES ('bar345','baz333 ar');
INSERT INTO t2 VALUES (2231626,64280,0);
INSERT INTO t2 VALUES (2231626,64281,0);
INSERT INTO t2 VALUES (12346, 3, 1);
SELECT * FROM t1;
id tag value
1 foo123 bar111
2 foo123 bar222
3 bar345 baz333 ar
SELECT * FROM t2;
id_t2 id_t1 field_number
12346 3 1
2231626 64280 0
2231626 64281 0
SELECT DISTINCT t2.id_t2 FROM t2, t1
WHERE MATCH (t1.value) AGAINST ('baz333') AND t1.id = t2.id_t1;
id_t2
12346
SELECT DISTINCT t2.id_t2 FROM t2, t1
WHERE MATCH (t1.value) AGAINST ('baz333' IN BOOLEAN MODE)
AND t1.id = t2.id_t1;
id_t2
12346
DROP TABLE t1, t2;