Issue Details (XML | Word | Printable)

Key: CORE-3453
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Adriano dos Santos Fernandes
Reporter: Kjell Rilbe
Votes: 0
Watchers: 1

If you were logged in you would be able to see more operations.
Firebird Core

Added not null timestamp col with default causes error on select of old null records

Created: 28/Apr/11 02:20 PM   Updated: 25/Sep/15 12:37 PM
Component/s: Engine
Affects Version/s: 2.1.4
Fix Version/s: 2.5.0

Environment: Windows
Issue Links:

QA Status: Done successfully

 Description  « Hide
FB 2.1 using isql, connect with utf8 to a database with default charset
utf8. Then try this (commits excluded for brevity):

create table "Temp" ("Dummy" int);
insert into "Temp" ("Dummy") values (1);
select * from "Temp";
alter table "Temp" add "New" timestamp default '0001-01-01' not null;
select * from "Temp";

This will result in an error (actual transcript):
SQL> select * from "Temp";

Dummy New
============ =========================
Statement failed, SQLCODE = -413
conversion error from string "00"

If I try it without specifying a connection charset there's no error and
the expected default is returned upon select.

I tried also with e.g. '1901-01-01' and then it complains about "19"
instead, so it appears to be (at least) the century that causes problems.

A workaround:
update "Temp" set "New" = '0001-01-01';
After that it seems to work.

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Adriano dos Santos Fernandes added a comment - 05/Jun/11 07:27 PM
I'm marking this as resolved in 2.5 caused there were very many related changes and problems with multi-byte literals.

A backport seems unlikely to happen.

Pavel Cisar added a comment - 25/Sep/15 12:37 PM
Test created.