Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Comparison of Fixnum with String failed #45

Closed
jostber opened this issue Dec 9, 2011 · 6 comments
Closed

Comparison of Fixnum with String failed #45

jostber opened this issue Dec 9, 2011 · 6 comments

Comments

@jostber
Copy link

jostber commented Dec 9, 2011

I edited an entry today and it was named with a number before the text, but now "t d all" does not work. Output of all commands with parameter all gives an error:

Comparison of Fixnum with String failed

or

Comparison of String with 10509 failed

Other commands seems to work like "t d "

@samg
Copy link
Owner

samg commented Dec 9, 2011

Very weird.

I did a quick test, and can't reproduce it, so I'll need a few more details.

First, which version of timetrap are you running?

Next could you run a command that raises the error with the --debug flag? You should get a stack trace that will point us to where the problem is.

@jostber
Copy link
Author

jostber commented Dec 12, 2011

Thanks, I use version 1.7.7.

Here is the output with the debug flag:

    t d all -s "2011-12-06" -e "2011-12-12" --debug
    /home/jostein/.timetrap/formatters/text.rb:14:in `sort': comparison of String with 10509 failed (ArgumentError)
    from /home/jostein/.timetrap/formatters/text.rb:14:in `initialize'
    from /usr/lib/ruby/gems/1.8/gems/timetrap-1.7.7/lib/timetrap/cli.rb:269:in `new'
    from /usr/lib/ruby/gems/1.8/gems/timetrap-1.7.7/lib/timetrap/cli.rb:269:in `display'
    from /usr/lib/ruby/gems/1.8/gems/timetrap-1.7.7/lib/timetrap/cli.rb:142:in `send'
    from /usr/lib/ruby/gems/1.8/gems/timetrap-1.7.7/lib/timetrap/cli.rb:142:in `invoke_command_if_valid'
    from /usr/lib/ruby/gems/1.8/gems/timetrap-1.7.7/lib/timetrap/cli.rb:119:in `invoke'
    from /usr/lib/ruby/gems/1.8/gems/timetrap-1.7.7/bin/t:11
    from /usr/bin/t:19:in `load'
    from /usr/bin/t:19

@samg
Copy link
Owner

samg commented Dec 13, 2011

@jostber I've been looking to this some more and am still a bit perplexed by why it's happening.

It seems like it's the same issue as #35, which was fixed in version 1.7.6 (95c887e). Basically sqlite will return integers from string columns if those can be coerced to numeric values (more details here: jeremyevans/sequel#365).

I thought maybe since you're a long time user the fix wouldn't work without recreating the db, but that doesn't seem to be the case.

My best guess is it's related to the version of the sequel, or sqlite gem you're running. Could you send me those versions? Also it looks like you're using a custom formatter (/home/jostein/.timetrap/formatters/text.rb) but I don't expect that's the problem.

I'd try upgrading the sequel gem and seeing if that fixes the problem. If not, send me the output of gem list and I'll see if I can make any more sense of it.

@jostber
Copy link
Author

jostber commented Dec 13, 2011

Thanks. Here is the output of 'gem list':

actionmailer (2.3.11)actionpack (2.3.11)
activerecord (2.3.11)
activeresource (2.3.11)
activesupport (2.3.11)
chronic (0.6.4, 0.3.0, 0.2.3)
crack (0.3.1)
diff-lcs (1.1.2)
getopt-declare (1.28)
gettext (2.1.0)
gettext_activerecord (2.1.0)
gettext_rails (2.1.0)
google-translate (0.7.2)
hoe (2.6.2)
httparty (0.8.1)
icalendar (1.1.6, 1.1.5)
json (1.6.3, 1.4.6)
json_pure (1.4.6)
locale (2.0.5)
locale_rails (2.0.6)
meta-spotify (0.1.5)
mime-types (1.16)
multi_json (1.0.3)
multi_xml (0.4.1)
OptionParser (0.5.1)
parseconfig (0.5.2)
rack (1.1.0)
rails (2.3.11)
rake (0.8.7)
ri_cal (0.8.7)
rubyforge (2.0.4)
sequel (3.15.0)
sinatra (1.2.6)
sqlite3 (1.3.3)
sqlite3-ruby (1.3.1)
taskjuggler (0.0.5)
taskwarrior-web (0.0.2)
tilt (1.3)
timetrap (1.7.7, 1.7.6, 1.7.5, 1.7.4, 1.7.3, 1.7.2, 1.6.0, 1.5.3, 1.5.1, 1.4.0)
vegas (0.1.8)
vim-ruby (2007.05.07)
vpim (0.695)

@jostber
Copy link
Author

jostber commented Dec 13, 2011

It seems like I solved have this issue now. Running the command 't list' also failed, and then I found that I had inadvertently entered an entry to a sheet called 10509. When I moved the entry and deleted the sheet everything works as expected again.

@samg
Copy link
Owner

samg commented Dec 17, 2011

Glad you fixed it.

This is still pretty weird. You should be able to name a sheet with a numeric value.

Cheers

@samg samg closed this as completed Dec 17, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants