You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
COMPUTED BY field's type are currently used only for describe the value.
Samples from CORE5092 (new ticket was created as Adriano suggested):
Sample-1.
SQL> recreate table test(
CON> t0 timestamp default 'now'
CON> ,t1 timestamp computed by( 'now' ) ---------------- ::: NB ::: 't1' has EXPLICITLY defined type: TIMESTAMP
CON> ,t2 computed by( extract(day from t1) ) ------------ Should TIMESTAMP type of 't1' be seen from here ?
CON> );
SQL> insert into test default values;
SQL> set list on;
SQL> select t0, t1 from test;
description: Samples from CORE5092 (new ticket was created as Adriano suggested):
Sample-1.
SQL> recreate table test(
CON> t0 timestamp default 'now'
CON> ,t1 timestamp computed by( 'now' ) ---------------- ::: NB ::: 't1' has EXPLICITLY defined type: TIMESTAMP
CON> ,t2 computed by( extract(day from t1) ) ------------ Should TIMESTAMP type of 't1' be seen from here ?
CON> );
SQL> insert into test default values;
SQL> set list on;
SQL> select t0, t1 from test;
Statement failed, SQLSTATE = 42000
expression evaluation not supported
-Invalid argument for EXTRACT() not being of DATE/TIME/TIMESTAMP type
SQL>
Sample-2
create table t1 (n1 integer, c1 integer computed by (1.2));
insert into t1 values (0);
commit;
select * from t1;
N1 C1
============ ============
0 1
select c1 || '' from t1;
CONCATENATION
1.2
=>
COMPUTED BY field's type are currently used only for describe the value.
Samples from CORE5092 (new ticket was created as Adriano suggested):
Sample-1.
SQL> recreate table test(
CON> t0 timestamp default 'now'
CON> ,t1 timestamp computed by( 'now' ) ---------------- ::: NB ::: 't1' has EXPLICITLY defined type: TIMESTAMP
CON> ,t2 computed by( extract(day from t1) ) ------------ Should TIMESTAMP type of 't1' be seen from here ?
CON> );
SQL> insert into test default values;
SQL> set list on;
SQL> select t0, t1 from test;
Statement failed, SQLSTATE = 42000
expression evaluation not supported
-Invalid argument for EXTRACT() not being of DATE/TIME/TIMESTAMP type
SQL>
Sample-2
create table t1 (n1 integer, c1 integer computed by (1.2));
insert into t1 values (0);
commit;
select * from t1;
N1 C1
============ ============
0 1
select c1 || '' from t1;
CONCATENATION
1.2
summary: Unexpected affect of COMPUTED-BY value on results in some cases => COMPUTED-BY expressions are not converted to their field type inside the engine
Submitted by: @pavel-zotov
COMPUTED BY field's type are currently used only for describe the value.
Samples from CORE5092 (new ticket was created as Adriano suggested):
Sample-1.
SQL> recreate table test(
CON> t0 timestamp default 'now'
CON> ,t1 timestamp computed by( 'now' ) ---------------- ::: NB ::: 't1' has EXPLICITLY defined type: TIMESTAMP
CON> ,t2 computed by( extract(day from t1) ) ------------ Should TIMESTAMP type of 't1' be seen from here ?
CON> );
SQL> insert into test default values;
SQL> set list on;
SQL> select t0, t1 from test;
T0 2016-02-01 16:21:00.2210
T1 2016-02-01 16:21:00.2210
SQL> select t0, t1, t2 from test;
Statement failed, SQLSTATE = 42000
expression evaluation not supported
-Invalid argument for EXTRACT() not being of DATE/TIME/TIMESTAMP type
SQL>
Sample-2
create table t1 (n1 integer, c1 integer computed by (1.2));
insert into t1 values (0);
commit;
select * from t1;
============ ============
0 1
select c1 || '' from t1;
CONCATENATION
1.2
Commits: b1efab5 04f5f59 1b3d63e 798a4a5 51d57b0 FirebirdSQL/fbt-repository@9847778 FirebirdSQL/fbt-repository@53be350 FirebirdSQL/fbt-repository@43becf3 FirebirdSQL/fbt-repository@b69a5e6 FirebirdSQL/fbt-repository@077e8af
The text was updated successfully, but these errors were encountered: