Issue Details (XML | Word | Printable)

Key: CORE-5194
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Critical Critical
Assignee: Adriano dos Santos Fernandes
Reporter: Carlos H. Cantu
Votes: 0
Watchers: 1
Operations

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

Invalid computed by definition generated by isql -x

Created: 11/Apr/16 04:52 PM   Updated: 12/Apr/16 05:23 PM
Component/s: ISQL
Affects Version/s: 3.0 RC2, 4.0 Initial
Fix Version/s: 3.0.0, 4.0 Alpha 1

QA Status: Done successfully


 Description  « Hide
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>


 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
There are no subversion log entries for this issue yet.