On Wednesday, September 11, 2013 9:18:13 AM UTC-7, GregD wrote:
>
> Jeremy-
>
> Down to 3 things to fix and this should be ready to implement into Sequel:
>
> 1) native disconnect - should I free the sqlany resources during a 
> disconnect or is there a way to remove the connection from the pool?
>

If you raise a Sequel::DatabaseDisconnectError if you detect a disconnect, 
Sequel will remove the related connection from the pool automatically.
 

> 2) jdbc and native - setting up a composite foreign key without an 
> exception and then dropping a foreign key causing a duplicate alter drop of 
> the same key.
>

I think I had an earlier post about this, where we should only send one 
alter drop in that case, not two, with a couple of different ideas about 
how to implement it.
 

> 3) jdbc - smallint not converting to a boolean.
>

Maybe we can try adding an explicit cast to integer in the SQL, so that it 
> doesn't use smallint implicitly, and would therefore have the values 
> returned as integers and not converted to booleans.  Around line 285 in the 
> plugin, doing this:
>
>   base_case = 
> base_case.select_more(SQL::AliasedExpression.new(Sequel.cast(0, Integer), 
> la))
>
> That obviously fixed it. Surprised another adapter that uses smallint as 
> boolean did not have this problem.  Probably sqlanywhere will default a 
> FIxnum type to the lowest native integer type that can hold the value if a 
> type has not been declared or cast.
>

Great!  I'm guessing we didn't hit this before because the other adapters 
that support CTEs and smallint to boolean conversions do not default the 
values to smallint by default.
 

>
> All of the Blob and escaping is fixed.  I had to do what the old mysql 
> adapter did in the dataset with:
>
>       # SQL fragment for String.  Doubles \ and ' by default.
>       def literal_string_append(sql, v)
>         sql << APOS << v.gsub(BACKSLASH_RE, QUAD_BACKSLASH).gsub(APOS_RE, 
> DOUBLE_APOS) << APOS
>       end
>
>       # SqlAnywhere uses a preceding X for hex escaping strings
>       def literal_blob_append(sql, v)
>         sql << BLOB_START << v.unpack(HSTAR).first
>       end
>
>
Great.  That sound hopefully make sure they aren't vulnerable to SQL 
injection issues.
 

> I saw that the cubrid adapter is using smallint as boolean and its jdbc 
> adapter is not making these pending.  So this leads me to think I'm not 
> setting something up right for my jdbc.
>

The cubrid support/database has enough issues that it doesn't try to pass 
the tests cleanly. The same is true for Microsoft Access.

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.

Reply via email to