Invalid computed by definition generated by isql -x
---------------------------------------------------

                 Key: CORE-5194
                 URL: http://tracker.firebirdsql.org/browse/CORE-5194
             Project: Firebird Core
          Issue Type: Bug
          Components: ISQL
    Affects Versions: 3.0 RC2
            Reporter: Carlos H. Cantu
            Priority: Critical


This came from Alexandre B. Smith... isql -x from FB 3 RC2 is generated invalid 
sql script when computed by fields exists. The test works fine in FB 2.5:

create database "c:\sp\test.fdb";


CREATE TABLE T (A TIMESTAMP,
        B COMPUTED BY (current_timestamp - a));


commit;


exit;


isql -user sysdba -password masterkey test.fdb -x > test.sql


The result is:
---------------------
SET SQL DIALECT 3; 


CREATE DATABASE 'test.fdb' PAGE_SIZE 8192 DEFAULT CHARACTER SET NONE;




COMMIT WORK;


/* Table: T, Owner: SYSDBA */
CREATE TABLE T (A TIMESTAMP,
        B NUMERIC(0, 9) COMPUTED BY (NULL));


/* Computed fields */


ALTER TABLE T 
        ALTER B TYPE NUMERIC(0, 9) COMPUTED BY (current_timestamp - a);


---------------------


Note the type of Column B defined as *NUMERIC(0,9)*


if you run it on isql you will get:
---------------------
Use CONNECT or CREATE DATABASE to specify a database
SQL> CREATE DATABASE 'test2.fdb' PAGE_SIZE 8192 DEFAULT CHARACTER SET NONE;
SQL>
SQL>
SQL> COMMIT WORK;
SQL>
SQL> /* Table: T, Owner: SYSDBA */
SQL> CREATE TABLE T (A TIMESTAMP,
CON>         B NUMERIC(0, 9) COMPUTED BY (NULL));
Statement failed, SQLSTATE = HY104
Dynamic SQL Error
-SQL error code = -842
-Precision must be from 1 to 18
SQL>
SQL> /* Computed fields */
SQL>
SQL> ALTER TABLE T
CON>         ALTER B TYPE NUMERIC(0, 9) COMPUTED BY (current_timestamp - a);
Statement failed, SQLSTATE = HY104
Dynamic SQL Error
-SQL error code = -842
-Precision must be from 1 to 18
SQL>


-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: 
http://tracker.firebirdsql.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial! http://pubads.g.doubleclick.net/
gampad/clk?id=1444514301&iu=/ca-pub-7940484522588532
Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to