<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Hacking MySQL: SIGNAL support (I)</title>
	<atom:link href="http://www.jorgebernal.info/opensource/hacking-mysql-signal-support-i/feed" rel="self" type="application/rss+xml" />
	<link>http://www.jorgebernal.info/opensource/hacking-mysql-signal-support-i</link>
	<description></description>
	<lastBuildDate>Sun, 11 Jul 2010 04:43:50 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=abc</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: hiutopor</title>
		<link>http://www.jorgebernal.info/opensource/hacking-mysql-signal-support-i/comment-page-1#comment-1111</link>
		<dc:creator>hiutopor</dc:creator>
		<pubDate>Mon, 17 Sep 2007 13:36:33 +0000</pubDate>
		<guid isPermaLink="false">http://koke.amedias.org/articles/2007/05/09/hacking-mysql-signal-support-i/#comment-1111</guid>
		<description>Hi 
 
Very interesting information! Thanks! 
 
G&#039;night</description>
		<content:encoded><![CDATA[<p>Hi </p>
<p>Very interesting information! Thanks! </p>
<p>G&#8217;night</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giuseppe Maxia</title>
		<link>http://www.jorgebernal.info/opensource/hacking-mysql-signal-support-i/comment-page-1#comment-852</link>
		<dc:creator>Giuseppe Maxia</dc:creator>
		<pubDate>Thu, 10 May 2007 07:50:44 +0000</pubDate>
		<guid isPermaLink="false">http://koke.amedias.org/articles/2007/05/09/hacking-mysql-signal-support-i/#comment-852</guid>
		<description>Jorge,
Thanks for this contribution. As you have seen from my previous example, it works as expected. You can even emulate constraints in triggers using this patch.

To be even more useful, SIGNAL should also return some user defined informations.

Before you get involved in any further development, however, be aware that in MySQL road map there is a plan to develop SIGNAL, RESIGNAL, and GET DIAGNOSTICS. You are free to develop your patch, but it&#039;s only fair that we let you know that, since we have ambitious plans, your patch is not likely to be included in our code base. 
I might be wrong about it. If you feel like doing more, please submit a proposal to MySQL &quot;internals&quot; mailing list (http://lists.mysql.com/internals) and then attach you patch to the feature request for SIGNAL (http://bugs.mysql.com/bug.php?id=11661).

Best regards

Giuseppe</description>
		<content:encoded><![CDATA[<p>Jorge,<br />
Thanks for this contribution. As you have seen from my previous example, it works as expected. You can even emulate constraints in triggers using this patch.</p>
<p>To be even more useful, SIGNAL should also return some user defined informations.</p>
<p>Before you get involved in any further development, however, be aware that in MySQL road map there is a plan to develop SIGNAL, RESIGNAL, and GET DIAGNOSTICS. You are free to develop your patch, but it&#8217;s only fair that we let you know that, since we have ambitious plans, your patch is not likely to be included in our code base.<br />
I might be wrong about it. If you feel like doing more, please submit a proposal to MySQL &#8220;internals&#8221; mailing list (<a href="http://lists.mysql.com/internals" rel="nofollow">http://lists.mysql.com/internals</a>) and then attach you patch to the feature request for SIGNAL (<a href="http://bugs.mysql.com/bug.php?id=11661" rel="nofollow">http://bugs.mysql.com/bug.php?id=11661</a>).</p>
<p>Best regards</p>
<p>Giuseppe</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Giuseppe Maxia</title>
		<link>http://www.jorgebernal.info/opensource/hacking-mysql-signal-support-i/comment-page-1#comment-850</link>
		<dc:creator>Giuseppe Maxia</dc:creator>
		<pubDate>Thu, 10 May 2007 06:00:12 +0000</pubDate>
		<guid isPermaLink="false">http://koke.amedias.org/articles/2007/05/09/hacking-mysql-signal-support-i/#comment-850</guid>
		<description>Here is a full example of this patch in action.


delimiter //

drop procedure if exists less_than_10 //
create procedure less_than_10(i int )
deterministic
begin
    if ( i  call less_than_10(2);
+--------------------------------------------------+
&#124; comment                                          &#124;
+--------------------------------------------------+
&#124; everything fine [a valid number was entered (2)] &#124;
+--------------------------------------------------+
1 row in set (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

mysql&gt; select @comment;
+--------------------------------+
&#124; @comment                       &#124;
+--------------------------------+
&#124; a valid number was entered (2) &#124;
+--------------------------------+
1 row in set (0.00 sec)

mysql&gt; call less_than_10(12);
ERROR 1340 (38503): Exception generated from user-defined function/procedure
mysql&gt; select @comment;
+----------------------+
&#124; @comment             &#124;
+----------------------+
&#124; number too high (12) &#124;
+----------------------+
1 row in set (0.00 sec)



mysql&gt; call trapping();
+--------------------------------------------------+
&#124; comment                                          &#124;
+--------------------------------------------------+
&#124; everything fine [a valid number was entered (7)] &#124;
+--------------------------------------------------+
1 row in set (0.00 sec)

+----------+--------------------------------+
&#124; mystatus &#124; @comment                       &#124;
+----------+--------------------------------+
&#124; ok       &#124; a valid number was entered (7) &#124;
+----------+--------------------------------+
1 row in set (0.00 sec)

+----------+----------------------+
&#124; mystatus &#124; @comment             &#124;
+----------+----------------------+
&#124; ERROR    &#124; number too high (17) &#124;
+----------+----------------------+
1 row in set (0.00 sec)

+-----------------------------+
&#124; and this is after the error &#124;
+-----------------------------+
&#124; and this is after the error &#124;
+-----------------------------+
1 row in set (0.00 sec)

Query OK, 0 rows affected (0.00 sec)

</description>
		<content:encoded><![CDATA[<p>Here is a full example of this patch in action.</p>
<p>delimiter //</p>
<p>drop procedure if exists less_than_10 //<br />
create procedure less_than_10(i int )<br />
deterministic<br />
begin<br />
    if ( i  call less_than_10(2);<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| comment                                          |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| everything fine [a valid number was entered (2)] |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
1 row in set (0.00 sec)</p>
<p>Query OK, 0 rows affected (0.00 sec)</p>
<p>mysql&gt; select @comment;<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| @comment                       |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| a valid number was entered (2) |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
1 row in set (0.00 sec)</p>
<p>mysql&gt; call less_than_10(12);<br />
ERROR 1340 (38503): Exception generated from user-defined function/procedure<br />
mysql&gt; select @comment;<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br />
| @comment             |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br />
| number too high (12) |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br />
1 row in set (0.00 sec)</p>
<p>mysql&gt; call trapping();<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| comment                                          |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| everything fine [a valid number was entered (7)] |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
1 row in set (0.00 sec)</p>
<p>+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| mystatus | @comment                       |<br />
+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| ok       | a valid number was entered (7) |<br />
+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
1 row in set (0.00 sec)</p>
<p>+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br />
| mystatus | @comment             |<br />
+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br />
| ERROR    | number too high (17) |<br />
+&#8212;&#8212;&#8212;-+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-+<br />
1 row in set (0.00 sec)</p>
<p>+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| and this is after the error |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
| and this is after the error |<br />
+&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;+<br />
1 row in set (0.00 sec)</p>
<p>Query OK, 0 rows affected (0.00 sec)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bouman</title>
		<link>http://www.jorgebernal.info/opensource/hacking-mysql-signal-support-i/comment-page-1#comment-848</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Wed, 09 May 2007 23:15:34 +0000</pubDate>
		<guid isPermaLink="false">http://koke.amedias.org/articles/2007/05/09/hacking-mysql-signal-support-i/#comment-848</guid>
		<description>uh oh...apparently all the less than and greater than text is interpreted as tags...darn...</description>
		<content:encoded><![CDATA[<p>uh oh&#8230;apparently all the less than and greater than text is interpreted as tags&#8230;darn&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bouman</title>
		<link>http://www.jorgebernal.info/opensource/hacking-mysql-signal-support-i/comment-page-1#comment-847</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Wed, 09 May 2007 23:14:18 +0000</pubDate>
		<guid isPermaLink="false">http://koke.amedias.org/articles/2007/05/09/hacking-mysql-signal-support-i/#comment-847</guid>
		<description>Hi! 

just wanted to ask you, the copy of the standard I&#039;m  currently using goes like this:

ISO/IEC 9075-4:2003 (E)

 ::=
     SIGNAL  [  ]

 ::=
     
  &#124; 

 ::= SET 

 ::=
      [ {   }... ]

 ::=
       

And this: 

 ::= SQLSTATE [ VALUE ] 

and this

 ::=
    [  ]
     [ ... ] 
    [ {   [ ... ]  }... ]


Anyway, this leads me to believe that it should be possible to pass whatever SQL state, and even a condition identifier of a previously defined condition. 

So something like 

SIGNAL SQLSTATE &#039;22000&#039;

should work just fine.

However, I just noticed that that gives a syntax error. Can you show a real syntax example? Or is this the only valid syntax now:

SIGNAL SQLSTATE &#039;38503&#039;

or even 

SIGNAL SQLSTATE 38503

(if so, I think the latter would violate the grammar of my copy of the standard)</description>
		<content:encoded><![CDATA[<p>Hi! </p>
<p>just wanted to ask you, the copy of the standard I&#8217;m  currently using goes like this:</p>
<p>ISO/IEC 9075-4:2003 (E)</p>
<p> ::=<br />
     SIGNAL  [  ]</p>
<p> ::=</p>
<p>  | </p>
<p> ::= SET </p>
<p> ::=<br />
      [ {   }... ]</p>
<p> ::=</p>
<p>And this: </p>
<p> ::= SQLSTATE [ VALUE ] </p>
<p>and this</p>
<p> ::=<br />
    [  ]<br />
     [ ... ]<br />
    [ {   [ ... ]  }&#8230; ]</p>
<p>Anyway, this leads me to believe that it should be possible to pass whatever SQL state, and even a condition identifier of a previously defined condition. </p>
<p>So something like </p>
<p>SIGNAL SQLSTATE &#8216;22000&#8242;</p>
<p>should work just fine.</p>
<p>However, I just noticed that that gives a syntax error. Can you show a real syntax example? Or is this the only valid syntax now:</p>
<p>SIGNAL SQLSTATE &#8216;38503&#8242;</p>
<p>or even </p>
<p>SIGNAL SQLSTATE 38503</p>
<p>(if so, I think the latter would violate the grammar of my copy of the standard)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roland Bouman</title>
		<link>http://www.jorgebernal.info/opensource/hacking-mysql-signal-support-i/comment-page-1#comment-845</link>
		<dc:creator>Roland Bouman</dc:creator>
		<pubDate>Wed, 09 May 2007 17:30:45 +0000</pubDate>
		<guid isPermaLink="false">http://koke.amedias.org/articles/2007/05/09/hacking-mysql-signal-support-i/#comment-845</guid>
		<description>Hi! 

great work! I&#039;ll try and get someone to contact you about this.

Roland</description>
		<content:encoded><![CDATA[<p>Hi! </p>
<p>great work! I&#8217;ll try and get someone to contact you about this.</p>
<p>Roland</p>
]]></content:encoded>
	</item>
</channel>
</rss>
