New Topic: Should 'or precondition's be Short Circuited (aka Lazy Evaluation)?

View: New views
1 Messages — Rating Filter:   Alert me  

New Topic: Should 'or precondition's be Short Circuited (aka Lazy Evaluation)?

by Nathan Voxland-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

A new topic, 'Should 'or precondition's be Short Circuited (aka Lazy Evaluation)?', has been made on a board you are watching.

You can see it at
http://liquibase.org/forum/index.php?topic=145.new#new

The text of the topic is shown below:

Should orpreconditions be short circuited?

As it is, you cannot have pre-conditions like "only run if this table is missing OR, if it exists, check that it contains a particular record".

e.g.

Code:
<precondition>
  <or>
    <not>
      <tableExists tableName="some_table"/>
    </not>
    <sqlCheck expectedResult="0">
      SELECT MAX(id)
      FROM some_table
    </sqlCheck>
  </or>
</precondition>


However, if orprecondition's were short-circuit and evaluated in the order that they appear, then once one condition evaluates to true, you do not need to continue evaluating other conditions in the or block.

Unsubscribe to new topics from this board by clicking here: http://liquibase.org/forum/index.php?action=notifyboard;board=2.0

Regards,
The LiquiBase Community Forum Team.
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day
trial. Simplify your report design, integration and deployment - and focus on
what you do best, core application coding. Discover what's new with
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Liquibase-devel mailing list
Liquibase-devel@...
https://lists.sourceforge.net/lists/listinfo/liquibase-devel