Quantcast

[FB-Tracker] Created: (CORE-5499) error due to computed field use reported at compilation of a query - s.b. at runtime

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[FB-Tracker] Created: (CORE-5499) error due to computed field use reported at compilation of a query - s.b. at runtime

JIRA tracker@firebirdsql.org
error due to computed field use reported at compilation of a query - s.b. at runtime
------------------------------------------------------------------------------------

                 Key: CORE-5499
                 URL: http://tracker.firebirdsql.org/browse/CORE-5499
             Project: Firebird Core
          Issue Type: Improvement
          Components: Engine
    Affects Versions: 2.5.7
         Environment: When compiling using C and preparing a query,
            Reporter: Ray Holme
            Priority: Minor


If the underlying table has a trigger updating (erroneously) a computed field ( == alternate name for another field), the reported error from my C code is

ISC error code: 335544359
SQLCODE: -151 doing prepare query from typedef
        - This column cannot be updated because it is derived from an SQL function or expression.

While this is true, it would have been much more helpful to report the error at runtime for the query when it tried to do the update.

This is a new feature to 2.5.7 as the error is NOT caught by 2.5.2.

I like the engine catching it  but the message is VERY confusing - it took many hours to find out what was really happening.

Either a better message should be given (it is a TABLE-COLUMN problem even though the offending  column is NOT in the query).
   or
Catch the problem later at runtime.

--- The query was
insert into visit_animals (visit_id, animal_id) values (?, ?)

--- the error was a logging trigger in visit_animals that
    update visits set synch_time = 'NOW' where visit_id = new.visit_id

--- and the field synch time is in visits but
       computed by datetime.

--- Fixing the trigger to use datetime -  removed the error (mine).


--
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

       

------------------------------------------------------------------------------
Announcing the Oxford Dictionaries API! The API offers world-renowned
dictionary content that is easy and intuitive to access. Sign up for an
account today to start using our lexical data to power your apps and
projects. Get started today and enter our developer competition.
http://sdm.link/oxford
Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel
Loading...