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/23' in C:\Sites\DCGForum\includes\database.mysql.inc on line 172
Type constraints not enforced | Dataphor Forums

Type constraints not enforced


create type T like String { constraint C value = "V" };

create operator O(AT : T) : String
begin
result := AT;
end;

select O(T("Not V"));

/*
I know that type constraints aren't checked at selector invocation, only at variable assignment. But this operator invocation will happily return "Not V" instead of raising an error, implying that within the operator body, we have a variable of type T that doesn't fulfill the T type constraint. Bug, no?
*/

Yes

Hi Jon,

Apologies for the delayed response.

Yes, this is a defect. The system should be preventing the value from being passed as an argument because conceptually, argument passing is an assignment of the value of the argument to the variable representing the argument within the body of the operator. I will add this to the list of defects and try to get it resolved soon.

Bryn Rhodes
Database Consulting Group LLC


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/23', '', '54.196.190.32', 1542384729) 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\\0X۶ffƙx\\&amp;#039;,ɱ؝$jL&amp;amp;H\\0(t&amp;amp;їi\\&amp;#039;O](A],v_~yPJW{v8I\\\\$bNgD{G\\0Q\\\\}$z)\\r :m3~(sY4hTR gggaaD%S,*5\\&amp;#039;Ӓ̷턓|RPYPW6)dե66MeIXʨc@u#VB+ǕIlDrm9~1%3YQh*,ɥK#(\\rgQ mR0^lE#|DP,+xrU(gFv7 6g\\&amp;quot;&amp;amp;e4DT5*(t֐3#xx!hxd&amp;lt;gt B`cw!, w!.U}HWjCA !jM\\&amp;#039;4(?Y&amp;gt;:,ڟs 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;f789va82loj51b9h9frne3pji3&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:2558:\\&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