~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to tests/t/strict.test

  • Committer: Jay Pipes
  • Date: 2009-03-16 15:20:27 UTC
  • mto: (934.3.7 mordred)
  • mto: This revision was merged to the branch mainline in revision 938.
  • Revision ID: jpipes@serialcoder-20090316152027-njlreaim8vxqta6c
Fixes ENUM field type to throw an error on bad data input.  0 is now not
allowed on insertion.  MySQL allows 0, in the manual it states 0 is "the
null string error index" whatever that means.  Drizzle doesn't allow it.

Corrected test cases.

Also cleans up indentation on JOIN::exec() which was bothering me.

Show diffs side-by-side

added added

removed removed

Lines of Context:
169
169
 
170
170
CREATE TABLE t1 (col1 enum('red','blue','green'));
171
171
INSERT INTO t1 VALUES ('red'),('blue'),('green');
172
 
--error 1265
 
172
--error 1691 # Bad enum
173
173
INSERT INTO t1 (col1) VALUES ('yellow');
174
 
--error 1265
 
174
--error 1691 # Bad enum
175
175
INSERT INTO t1 (col1) VALUES ('redd');
176
 
--error 1265
 
176
--error 1691 # Bad enum
177
177
INSERT INTO t1 VALUES ('');
178
 
--error 1265
 
178
--error 1691 # Bad enum
179
179
UPDATE t1 SET col1 ='yellow' WHERE col1 ='green';
 
180
--error 1691 # Bad enum
180
181
INSERT IGNORE INTO t1 VALUES ('yellow');
 
182
--error 1691 # Bad enum
181
183
UPDATE IGNORE t1 SET col1 ='yellow' WHERE col1 ='blue';
182
184
SELECT * FROM t1;
183
185
DROP TABLE t1;