Warning: Table '.\dcgforum\cache_page' is marked as crashed and should be repaired query: SELECT data, created, headers, expire FROM cache_page WHERE cid = 'http://forums.dataphor.org/index.php?q=node/44' in C:\Sites\DCGForum\includes\database.mysql.inc on line 172
add expression not evaluated in form | Dataphor Forums

add expression not evaluated in form

create table T { A : Integer };

create operator Op1(B : Boolean) : String
begin
result := ToString(if B then DateTime() else DateTime() - Days(180));
end;

create operator Op2(B : Boolean) : String
begin
if B then raise Error("B!") else result := ToString(Count(T));
end;

Create a form with a source with the expression

TableDee add { false B tags { DAE.IsComputed = "false" } } add { Op1(B) Op1, Op2(B) Op2 }

, and data controls for the three attributes. (I would attach the form I've tested with, but this forum doesn't seem to support neither file attachments nor inlining xml code.) When the source is enabled, it works as expected; the TextBox for Op2 gets a 0. But when I toggle B, only Op1 is re-evaluated -- Op2 is for some reason simply blanked. The Op2 operator isn't called at all.

Op1() is non-deterministic while Op2() is deterministic, but I can't see how that would justify this behaviour. Using modifiers to give both operators the same properties makes no difference either. I have tried various operators, and it seems that it is the reference to a relation variable that causes an operator to be ignored.

Note that this is in 2.1.2711. In 3.0.3602, toggling B fails with this error message (sometimes repeated indefinitely, so I have to kill Dataphoria):

Application:121104 --->
Record not found.
---- Server Context ----
at Alphora.Dataphor.DAE.Client.DataView.PrepareApplicationTransactionServer(Boolean AIsInsert)
at Alphora.Dataphor.DAE.Client.DataView.InternalEdit()
at Alphora.Dataphor.DAE.Client.DataSet.Edit()
at Alphora.Dataphor.DAE.Client.FieldDataLink.Edit()
at Alphora.Dataphor.DAE.Client.Controls.DBCheckBox.OnClick(EventArgs AEventArgs)
at System.Windows.Forms.CheckBox.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


Warning: Table '.\dcgforum\watchdog' is marked as crashed and should be repaired query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '<em>Table &amp;#039;.\\dcgforum\\cache_page&amp;#039; is marked as crashed and should be repaired\nquery: LOCK TABLES cache_page WRITE</em> in <em>C:\\Sites\\DCGForum\\includes\\database.mysql.inc</em> on line <em>172</em>.', 2, '', 'http://forums.dataphor.org/index.php?q=node/44', '', '54.196.190.32', 1542384681) in C:\Sites\DCGForum\includes\database.mysql.inc on line 172

Warning: Table '.\dcgforum\watchdog' is marked as crashed and should be repaired query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '<em>Table &amp;#039;.\\dcgforum\\cache_page&amp;#039; is marked as crashed and should be repaired\nquery: UPDATE cache_page SET data = &amp;#039;\\0\\0\\0\\0\\0\\0Yr6?3}73&amp;amp;)ɞkHW[k\\Zr7N\\&amp;quot;! g`\\0вL^q$[(Gv$v,bw?\\&amp;quot;g/N|yΖ6\\&amp;#039;O/NY8&amp;gt;0}\\r&amp;gt;{eLl?zX&amp;lt;j\\&amp;quot;\\rhe= [6\\r&amp;amp;_=9AyVǏeXQMHh)xF[i31iu1RP+U܊ɂ͕ٿ\\\\*;S(kVZxWɫqp\\n+\\nNץXƁ6&amp;amp;5dɵv\\\\y(`(%\\&amp;quot;lRY&amp;amp;4`K- Lx56+0 9@|!ЯKLNĘ\\&amp;quot;|, &amp;amp;y ,sV$Pp?Ŏ tffmTyYY/ in C:\Sites\DCGForum\includes\database.mysql.inc on line 172

Warning: Table '.\dcgforum\watchdog' is marked as crashed and should be repaired query: INSERT INTO watchdog (uid, type, message, severity, link, location, referer, hostname, timestamp) VALUES (0, 'php', '<em>Incorrect string value: &amp;#039;\\x8B\\x08\\0\\0...&amp;#039; for column &amp;#039;session&amp;#039; at row 1\nquery: INSERT INTO sessions (sid, uid, cache, hostname, session, timestamp) VALUES (&amp;#039;hepqg6l6s1mu09rgg9ksg1tpn0&amp;#039;, 0, 0, &amp;#039;54.196.190.32&amp;#039;, &amp;#039;messages|a:1:{s:5:\\&amp;quot;error\\&amp;quot;;a:2:{i:0;s:195:\\&amp;quot;user warning: Table &amp;amp;#039;.\\\\dcgforum\\\\cache_page&amp;amp;#039; is marked as crashed and should be repaired\\nquery: LOCK TABLES cache_page WRITE in C:\\\\Sites\\\\DCGForum\\\\includes\\\\database.mysql.inc on line 172.\\&amp;quot;;i:1;s:3002:\\&amp;quot;user warning: Table &amp;amp;#039;.\\\\dcgforum\\\\cache_page&amp;amp;#039; is mark in C:\Sites\DCGForum\includes\database.mysql.inc on line 172