accepts invalid dates

Bug #310513 reported by Stewart Smith
2
Affects Status Importance Assigned to Milestone
Drizzle
Fix Released
Critical
Jay Pipes

Bug Description

from strict.test:

CREATE TABLE t1 (col1 date);
INSERT INTO t1 VALUES('2004-01-01'),('2004-02-29');
INSERT INTO t1 VALUES('0000-10-31');

# All test cases expected to fail should return
# SQLSTATE 22007 <invalid date value>
--error 1292
INSERT INTO t1 VALUES('2004-0-31');
--error 1292
INSERT INTO t1 VALUES('2004-01-02'),('2004-0-31');
--error 1292
INSERT INTO t1 VALUES('2004-10-0');
--error 1292
INSERT INTO t1 VALUES('2004-09-31');
--error 1292
INSERT INTO t1 VALUES('2004-10-32');
--error 1292
INSERT INTO t1 VALUES('2003-02-29');
--error 1292
INSERT INTO t1 VALUES('2004-13-15');
--error 1292
INSERT INTO t1 VALUES('0000-00-00');
# Standard says we should return SQLSTATE 22018
--error 1292
INSERT INTO t1 VALUES ('59');

broken.strict [ fail ]

drizzletest: At line 18: query 'INSERT INTO t1 VALUES('2004-0-31')' succeeded - should have failed with errno 1292...

Revision history for this message
Stewart Smith (stewart) wrote :

looks like 0th month or 0th day is the problem (we succeed when should fail)

Revision history for this message
Jay Pipes (jaypipes) wrote :

Assigning to myself. Will be fixed in ~jaypipes/drizzle/temporal branch

Changed in drizzle:
assignee: nobody → jaypipes
importance: Undecided → Critical
status: New → Confirmed
Revision history for this message
Jay Pipes (jaypipes) wrote :

Fixed:

jpipes@serialcoder:~/repos/drizzle/trunk-with-temporal/tests$ ../client/drizzle --user=root --port=9306
Welcome to the Drizzle client.. Commands end with ; or \g.
Your Drizzle connection id is 1
Server version: 7.0.0 Source distribution

Type 'help;' or '\h' for help. Type '\c' to clear the buffer.

drizzle> use test
Database changed
drizzle> create table t1 (d1 date not null);
Query OK, 0 rows affected (0.02 sec)

drizzle> INSERT INTO t1 VALUES('2004-0-31');
ERROR 1686 (HY000): Received an invalid datetime value '2004-0-31'.

Changed in drizzle:
milestone: none → tarball
status: Confirmed → Fix Committed
Jay Pipes (jaypipes)
Changed in drizzle:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.