mirror of
				https://github.com/MariaDB/server.git
				synced 2025-10-31 15:50:51 +03:00 
			
		
		
		
	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.
		
			
				
	
	
		
			25 lines
		
	
	
		
			930 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			25 lines
		
	
	
		
			930 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| drop table if exists test;
 | |
| CREATE TABLE test (
 | |
| gnr INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
 | |
| url VARCHAR(80) DEFAULT '' NOT NULL,
 | |
| shortdesc VARCHAR(200) DEFAULT '' NOT NULL,
 | |
| longdesc text DEFAULT '' NOT NULL,
 | |
| description VARCHAR(80) DEFAULT '' NOT NULL,
 | |
| name VARCHAR(80) DEFAULT '' NOT NULL,
 | |
| FULLTEXT(url,description,shortdesc,longdesc),
 | |
| PRIMARY KEY(gnr)
 | |
| );
 | |
| Warnings:
 | |
| Warning	1101	BLOB/TEXT column 'longdesc' can't have a default value
 | |
| insert into test (url,shortdesc,longdesc,description,name) VALUES 
 | |
| ("http:/test.at", "kurz", "lang","desc", "name");
 | |
| insert into test (url,shortdesc,longdesc,description,name) VALUES 
 | |
| ("http:/test.at", "kurz", "","desc", "name");
 | |
| update test set url='test', description='ddd', name='nam' where gnr=2;
 | |
| update test set url='test', shortdesc='ggg', longdesc='mmm', 
 | |
| description='ddd', name='nam' where gnr=2;
 | |
| check table test;
 | |
| Table	Op	Msg_type	Msg_text
 | |
| test.test	check	status	OK
 | |
| drop table test;
 |