----- Original Message -----

From: "Jeremy Evans" <[email protected]> 
To: [email protected] 
Sent: Thursday, August 15, 2013 6:33:05 PM 
Subject: Re: Sybase SqlAnywhere Adapter Dataset operation not graphing 
correctly 


On Thursday, August 15, 2013 12:37:27 PM UTC-7, GregD wrote: 





On Aug 15, 2013, at 11:27 AM, Jeremy Evans < [email protected] > wrote: 

<blockquote>

On Thursday, August 15, 2013 6:37:31 AM UTC-7, GregD wrote: 
<blockquote>

Anyone- 


Trying to get Sybase SqlAnywhere to work for Sequel using the native 
sqlanywhere driver: https://github.com/sqlanywhere/sqlanywhere and having a few 
issues with the integration tests. I just started this in my spare time, so I 
haven't gotten very far yet. One thing that has me stuck are these 2 failing 
tests and need a solution is: 


rspec ./spec/integration/dataset_test.rb:67 # Simple Dataset operations should 
graph correctly 
rspec ./spec/integration/dataset_test.rb:71 # Simple Dataset operations should 
graph correctly with a subselect 




The SQL generated is correct and works in the Sybase Client software: 


"SELECT * FROM \"ITEMS\" LEFT OUTER JOIN \"ITEMS\" AS \"B\" ON (\"B\".\"ID\" = 
\"ITEMS\".\"ID\")" 




That's not the correct SQL. A graph should always have explicitly qualified 
selections. For example, on SQLite: 

SELECT `items`.`id`, `items`.`number`, `b`.`id` AS 'b_id', `b`.`number` AS 
'b_number' FROM `items` LEFT OUTER JOIN `items` AS 'b' ON (`b`.`id` = 
`items`.`id`) 

So the first thing you should do is find out why it isn't generating the 
correct SQL. 

</blockquote>

How? This is from the select_clause_methods. It looks right or follows others. 
Not sure maybe something in the old mssql shared adapter I copied is not making 
it work. Agree, the problem is there is no b_id or b_number which would give me 
the 4 name/value pairs. I'll dig. 

</blockquote>


Your Dataset#fetch_rows method does not set @columns. I think if you update the 
method so that it sets @columns to an array of column symbols in the dataset, 
that will fix things. 


Jeremy- 


Thanks! I have it working now. I've started to delete a lot of unnecessary code 
from the old copy of mssql adapter that I copied from. I looked at others and 
re-engineered the Dataset#fetch_rows and Database#execute methods. I've updated 
the gist, but it is far from done. I'll continue to fix the failing code and 
hopefully I can get a native one working here soon. 


As far as a jdbc one, I should be able to do that fairly quickly since I had 
the Sybase java jconn4 stuff working years ago. I'll send it though its paces 
(integration test) using the latest jruby. 


As far a ODBC, is there anything there other than running the tests on a 
Windows box? I'd like to leave the odbc out, but we are a java shop that runs 
our software on Windows and in some cases we go through a ODBC pipe on Windows 
servers (can I say yuck to windows?). 


Regards, 


-GregD 


Thanks, 
Jeremy 

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group. 
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected]. 
To post to this group, send email to [email protected]. 
Visit this group at http://groups.google.com/group/sequel-talk . 
For more options, visit https://groups.google.com/groups/opt_out . 

-- 
You received this message because you are subscribed to the Google Groups 
"sequel-talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sequel-talk.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to