> Can you please supply a patch for the mysql spec as well?
>
> sharon

Here it is:

Index: spec/adapters/mysql_spec.rb
===================================================================
--- spec/adapters/mysql_spec.rb (revision 523)
+++ spec/adapters/mysql_spec.rb (working copy)
@@ -217,6 +217,20 @@
       end
       group_by :minute[:from_unixtime[:ack]]
     end.sql.should == \
-      "SELECT `market`, minute(from_unixtime(`ack`)) AS `minute` FROM
orders WHERE ((`ack` > TIMESTAMP '2007-11-06 19:11:01') AND (`market`
= 'ICE')) GROUP BY minute(from_unixtime(`ack`))"
+      "SELECT `market`, minute(from_unixtime(`ack`)) AS `minute` FROM
orders WHERE ((`ack` > TIMESTAMP '#{ack_stamp.strftime('%Y-%m-%d %H:%M:
%S')}') AND (`market` = 'ICE')) GROUP BY minute(from_unixtime(`ack`))"
   end
-end
\ No newline at end of file
+end
+
+context "Simple stored procedure test" do
+  setup do
+    # Create a simple stored procedure but drop it first if there
+    MYSQL_DB.execute("DROP PROCEDURE IF EXISTS sp_get_server_id;")
+    MYSQL_DB.execute("CREATE PROCEDURE sp_get_server_id() SQL
SECURITY DEFINER SELECT @@SERVER_ID as server_id;")
+  end
+
+  specify "should return the server-id via a stored procedure call"
do
+    @server_id = MYSQL_DB["SELECT @@SERVER_ID as
server_id;"].first[:server_id] # grab the server_id via a simple query
+    @server_id_by_sp = MYSQL_DB["CALL
sp_get_server_id();"].first[:server_id]
+    @server_id_by_sp.should == @server_id  # compare it to output
from stored procedure
+  end
+end

On a system without the patch you will get:
Mysql::Error in 'Simple stored procedure test should return the server-
id via a stored procedure call'
PROCEDURE sandbox.sp_get_server_id can't return a result set in the
given context

Please note that I patched also the spec called "Chuck's test stage 1"
as for some reason the date was hard coded in the spec file...

Let me know if I missed anything ;)

Thanks!

Sébastien


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/sequel-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to