[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

ruby-sqlite 2.2.3 bug

Jon A. Lambert

3/17/2006 4:13:00 PM

This is using sqlite-ruby (2.2.3)

-----------------------
require 'sqlite'
require 'pp'

class Foo
end
db = SQLite::Database.open("test.sqlite")
begin
db.execute("drop table test;")
rescue
end
db.execute("create table test (id integer primary key, data object);")
db.type_translation = true
db.translator.add_translator("object") {|type, value|
db.class.decode value
}
db.execute("insert into test values (1, ?);", db.class.encode(Foo.new))
db.execute("select * from test;") do |row|
pp row
end
#db.type_translation = false <== uncomment to make work
pp db.execute("pragma table_info(test)") <======= bug here
db.table_info("test") do |row| <===== and here
pp row
end
----------------------

[1, #<Foo:0x2c35ee0>]
C:/apps/ruby/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3-mswin32/lib/sqlite/translator.rb:85:in
`type_name': undefined method `upcase' for nil:NilClass (NoMethodError)
from
C:/apps/ruby/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3-mswin32/lib/sqlite/translator.rb:77:in
`translate'
from
C:/apps/ruby/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3-mswin32/lib/sqlite/resultset.rb:136:in
`next'
from
C:/apps/ruby/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3-mswin32/lib/sqlite/resultset.rb:135:in
`next'
from
C:/apps/ruby/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3-mswin32/lib/sqlite/resultset.rb:161:in
`each'
from
C:/apps/ruby/lib/ruby/gems/1.8/gems/sqlite-ruby-2.2.3-mswin32/lib/sqlite/database.rb:199:in
`execute'
from C:/work/teensymud/trunk/testsql.rb:21

Switching type_translation off allows pragma to work.

Also example in documentation, shows 'db.decode' instead of
'db.class.decode'

--
J. Lambert



10 Answers

William Clark

12/19/2010 5:58:00 PM

0

In article <2eCdnc_e48_gi5DQnZ2dnUVZ_qmdnZ2d@giganews.com>,
"conwaycaine" <conwaycaine@bellsouth.net> wrote:

> "William Clark" <wclark2@colnospamumbus.rr.com> wrote in message
> news:wclark2-5711CC.12175718122010@charm.magnus.acs.ohio-state.edu...
> > "conwaycaine" <conwaycaine@bellsouth.net> wrote:
>
> >> >> > More impressive than someone who cannot spell "defendant".
> >> >> >
> >> >> > By a long way. You are comical.
> >> >>
> >> >> You compose a sentence comprised of "By a long way" and you question
> >> >> Fred's
> >> >> command of the English language?
> >> >
> >> > "It is" is implied. I see you were not an English major - or even
> >> > minor.
> >>
> >> Not so.
> >> Nothing implied.
> >> Just a poorly constructed sentence.
> >> The hilarious part here is that you put forth that travesty in a spelling
> >> flame.
> >> Really, Bill, if you need resort to flame spellings, please make sure you
> >> adhere to the rules of grammar.
> >
> > We are on the Usenet in what is, at best, a colloquial environment.
> > Therefore such contractions are permissible. Spelling errors, however,
> > do not fall under this exception.
>
> Do you have statistics to back up that outlandish claim???

Absolutely.

William Clark

12/19/2010 5:59:00 PM

0

In article <uubqg6dcpn152aum1326e4jvjbvn9gii7n@4ax.com>,
Fred J. McCall <fjmccall@gmail.com> wrote:

> "conwaycaine" <conwaycaine@bellsouth.net> wrote:
>
> >
> >"William Clark" <wclark2@colnospamumbus.rr.com> wrote in message
> >news:wclark2-5711CC.12175718122010@charm.magnus.acs.ohio-state.edu...
> >> "conwaycaine" <conwaycaine@bellsouth.net> wrote:
> >
> >>> >> > More impressive than someone who cannot spell "defendant".
> >>> >> >
> >>> >> > By a long way. You are comical.
> >>> >>
> >>> >> You compose a sentence comprised of "By a long way" and you question
> >>> >> Fred's
> >>> >> command of the English language?
> >>> >
> >>> > "It is" is implied. I see you were not an English major - or even
> >>> > minor.
> >>>
> >>> Not so.
> >>> Nothing implied.
> >>> Just a poorly constructed sentence.
> >>> The hilarious part here is that you put forth that travesty in a spelling
> >>> flame.
> >>> Really, Bill, if you need resort to flame spellings, please make sure you
> >>> adhere to the rules of grammar.
> >>
> >> We are on the Usenet in what is, at best, a colloquial environment.
> >> Therefore such contractions are permissible. Spelling errors, however,
> >> do not fall under this exception.
> >>
> >
> >Do you have statistics to back up that outlandish claim???
> >
>
> He just "nos" he's right, Conway...

Thank you for finally acknowledging it :-)

conwaycaine

12/19/2010 7:07:00 PM

0


"conwaycaine" <conwaycaine@bellsouth.net> wrote in message
news:F42dncQxo6g2UJHQnZ2dnUVZ_uOdnZ2d@giganews.com...
> "William Clark" <wclark2@colnospamumbus.rr.com> wrote in message
> news:wclark2-E374E6.17403817122010@charm.magnus.acs.ohio-state.edu...

>>> > By a long way. You are comical.
>>>
>>> You compose a sentence comprised of "By a long way" and you question
>>> Fred's
>>> command of the English language?
>>
>> "It is" is implied. I see you were not an English major - or even minor.

Come to think of it, were the sentence written as "It is by a long way", it
would not be a sterling example of proper use of the Queen's English.
Are we sure you are a bonifide academician?
Or are we dealing with yet another Walter Mitty?


conwaycaine

12/19/2010 7:09:00 PM

0


"Fred J. McCall" <fjmccall@gmail.com> wrote in message
news:uubqg6dcpn152aum1326e4jvjbvn9gii7n@4ax.com...
> "conwaycaine" <conwaycaine@bellsouth.net> wrote:
>>"William Clark" <wclark2@colnospamumbus.rr.com> wrote in message

>>> We are on the Usenet in what is, at best, a colloquial environment.
>>> Therefore such contractions are permissible. Spelling errors, however,
>>> do not fall under this exception.
>>>
>>
>>Do you have statistics to back up that outlandish claim???
>>
>
> He just "nos" he's right, Conway...

He is, as you say, truly hooked and gaffed.
By now, he must surely be quite surly around the kitchen table.


conwaycaine

12/19/2010 7:09:00 PM

0


"William Clark" <wclark2@colnospamumbus.rr.com> wrote in message
news:wclark2-C78E59.12582119122010@charm.magnus.acs.ohio-state.edu...
> In article <2eCdnc_e48_gi5DQnZ2dnUVZ_qmdnZ2d@giganews.com>,
> "conwaycaine" <conwaycaine@bellsouth.net> wrote:
>
>> "William Clark" <wclark2@colnospamumbus.rr.com> wrote in message
>> news:wclark2-5711CC.12175718122010@charm.magnus.acs.ohio-state.edu...
>> > "conwaycaine" <conwaycaine@bellsouth.net> wrote:
>>
>> >> >> > More impressive than someone who cannot spell "defendant".
>> >> >> >
>> >> >> > By a long way. You are comical.
>> >> >>
>> >> >> You compose a sentence comprised of "By a long way" and you
>> >> >> question
>> >> >> Fred's
>> >> >> command of the English language?
>> >> >
>> >> > "It is" is implied. I see you were not an English major - or even
>> >> > minor.
>> >>
>> >> Not so.
>> >> Nothing implied.
>> >> Just a poorly constructed sentence.
>> >> The hilarious part here is that you put forth that travesty in a
>> >> spelling
>> >> flame.
>> >> Really, Bill, if you need resort to flame spellings, please make sure
>> >> you
>> >> adhere to the rules of grammar.
>> >
>> > We are on the Usenet in what is, at best, a colloquial environment.
>> > Therefore such contractions are permissible. Spelling errors, however,
>> > do not fall under this exception.
>>
>> Do you have statistics to back up that outlandish claim???
>
> Absolutely.

Might we see them???


William Clark

12/19/2010 9:28:00 PM

0

In article <dcCdnfiWyYcmypPQnZ2dnUVZ_sidnZ2d@giganews.com>,
"conwaycaine" <conwaycaine@bellsouth.net> wrote:

> "William Clark" <wclark2@colnospamumbus.rr.com> wrote in message
> news:wclark2-C78E59.12582119122010@charm.magnus.acs.ohio-state.edu...
> > In article <2eCdnc_e48_gi5DQnZ2dnUVZ_qmdnZ2d@giganews.com>,
> > "conwaycaine" <conwaycaine@bellsouth.net> wrote:
> >
> >> "William Clark" <wclark2@colnospamumbus.rr.com> wrote in message
> >> news:wclark2-5711CC.12175718122010@charm.magnus.acs.ohio-state.edu...
> >> > "conwaycaine" <conwaycaine@bellsouth.net> wrote:
> >>
> >> >> >> > More impressive than someone who cannot spell "defendant".
> >> >> >> >
> >> >> >> > By a long way. You are comical.
> >> >> >>
> >> >> >> You compose a sentence comprised of "By a long way" and you
> >> >> >> question
> >> >> >> Fred's
> >> >> >> command of the English language?
> >> >> >
> >> >> > "It is" is implied. I see you were not an English major - or even
> >> >> > minor.
> >> >>
> >> >> Not so.
> >> >> Nothing implied.
> >> >> Just a poorly constructed sentence.
> >> >> The hilarious part here is that you put forth that travesty in a
> >> >> spelling
> >> >> flame.
> >> >> Really, Bill, if you need resort to flame spellings, please make sure
> >> >> you
> >> >> adhere to the rules of grammar.
> >> >
> >> > We are on the Usenet in what is, at best, a colloquial environment.
> >> > Therefore such contractions are permissible. Spelling errors, however,
> >> > do not fall under this exception.
> >>
> >> Do you have statistics to back up that outlandish claim???
> >
> > Absolutely.
>
> Might we see them???

No.

William Clark

12/19/2010 9:28:00 PM

0

In article <ip6dnfJFpqwCypPQnZ2dnUVZ_judnZ2d@giganews.com>,
"conwaycaine" <conwaycaine@bellsouth.net> wrote:

> "Fred J. McCall" <fjmccall@gmail.com> wrote in message
> news:uubqg6dcpn152aum1326e4jvjbvn9gii7n@4ax.com...
> > "conwaycaine" <conwaycaine@bellsouth.net> wrote:
> >>"William Clark" <wclark2@colnospamumbus.rr.com> wrote in message
>
> >>> We are on the Usenet in what is, at best, a colloquial environment.
> >>> Therefore such contractions are permissible. Spelling errors, however,
> >>> do not fall under this exception.
> >>>
> >>
> >>Do you have statistics to back up that outlandish claim???
> >>
> >
> > He just "nos" he's right, Conway...
>
> He is, as you say, truly hooked and gaffed.
> By now, he must surely be quite surly around the kitchen table.

Actually, you have made my week. I haven't laughed so hard at a couple
of fish flapping on a plate for years.

Please keep it up.

William Clark

12/19/2010 9:29:00 PM

0

In article <H6edneJqY6WMypPQnZ2dnUVZ_rmdnZ2d@giganews.com>,
"conwaycaine" <conwaycaine@bellsouth.net> wrote:

> "conwaycaine" <conwaycaine@bellsouth.net> wrote in message
> news:F42dncQxo6g2UJHQnZ2dnUVZ_uOdnZ2d@giganews.com...
> > "William Clark" <wclark2@colnospamumbus.rr.com> wrote in message
> > news:wclark2-E374E6.17403817122010@charm.magnus.acs.ohio-state.edu...
>
> >>> > By a long way. You are comical.
> >>>
> >>> You compose a sentence comprised of "By a long way" and you question
> >>> Fred's
> >>> command of the English language?
> >>
> >> "It is" is implied. I see you were not an English major - or even minor.
>
> Come to think of it, were the sentence written as "It is by a long way", it
> would not be a sterling example of proper use of the Queen's English.
> Are we sure you are a bonifide academician?
> Or are we dealing with yet another Walter Mitty?

Or another Freddie McCall?

conwaycaine

12/20/2010 3:31:00 PM

0


"William Clark" <wclark2@colnospamumbus.rr.com> wrote in message
news:wclark2-76CD42.16285219122010@charm.magnus.acs.ohio-state.edu...
> In article <H6edneJqY6WMypPQnZ2dnUVZ_rmdnZ2d@giganews.com>,
> "conwaycaine" <conwaycaine@bellsouth.net> wrote:
>
>> "conwaycaine" <conwaycaine@bellsouth.net> wrote in message
>> news:F42dncQxo6g2UJHQnZ2dnUVZ_uOdnZ2d@giganews.com...
>> > "William Clark" <wclark2@colnospamumbus.rr.com> wrote in message
>> > news:wclark2-E374E6.17403817122010@charm.magnus.acs.ohio-state.edu...
>>
>> >>> > By a long way. You are comical.
>> >>>
>> >>> You compose a sentence comprised of "By a long way" and you question
>> >>> Fred's
>> >>> command of the English language?
>> >>
>> >> "It is" is implied. I see you were not an English major - or even
>> >> minor.
>>
>> Come to think of it, were the sentence written as "It is by a long way",
>> it
>> would not be a sterling example of proper use of the Queen's English.
>> Are we sure you are a bonifide academician?
>> Or are we dealing with yet another Walter Mitty?
>
> Or another Freddie McCall?

Have you seen any of the incarnations of "Nightmare on Elm Street"?


conwaycaine

12/20/2010 3:32:00 PM

0


"William Clark" <wclark2@colnospamumbus.rr.com> wrote in message
news:wclark2-382A61.16274019122010@charm.magnus.acs.ohio-state.edu...
> "conwaycaine" <conwaycaine@bellsouth.net> wrote:

>> >> Do you have statistics to back up that outlandish claim???
>> >
>> > Absolutely.
>>
>> Might we see them???
>
> No.

No matter. We have your word.