Ticket #709 (defect)

Opened 4 months ago

Last modified 2 months ago

/mobile/ URL request results in error

Status: closed (invalid)

Reported by: emoryl at gmail.com Assigned to: lrbalt
Priority: low Milestone:
Component: Coding Version: 1.5
Severity: normal Keywords: mac osx tracks ruby bug report error sqlite
Cc:

Using naked 1.5 SVN checkout.

tracks.hellyeah.com/mobile/ is my mobile url, but viewing it generates the following output:

ActiveRecord?::StatementInvalid? (SQLite3::SQLException: near "DISTINCT": syntax error: SELECT count(DISTINCT todos.id) AS count_all FROM todos LEFT OUTER JOIN projects ON projects.id = todos.project_id LEFT OUTER JOIN contexts ON contexts.id = todos.context_id WHERE (todos.user_id 1 and todos.state = 'active' and contexts.hide = 'f' AND (projects.state = 'active' OR todos.project_id IS NULL)) ORDER BY todos.due IS NULL, todos.due ASC, todos.created_at ASC ): /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract_adapter.rb:128:in log' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:145:in execute' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:347:in catch_schema_changes' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:145:in execute' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:165:in select_all' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activerecord/lib/active_record/connection_adapters/sqlite_adapter.rb:177:in select_one' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activerecord/lib/active_record/connection_adapters/abstract/database_statements.rb:19:in `select_value'

/Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activerecord/lib/active_record/calculations.rb:212:in `execute_simple_calculation' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activerecord/lib/active_record/calculations.rb:121:in `calculate' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activerecord/lib/active_record/calculations.rb:117:in `calculate' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activerecord/lib/active_record/calculations.rb:45:in `count' /Volumes/miniStack/Users/emory/tracks-current/app/controllers/todos_controller.rb:447:in `determine_down_count' /Volumes/miniStack/Users/emory/tracks-current/lib/source_view.rb:17:in `method_missing' /Volumes/miniStack/Users/emory/tracks-current/app/controllers/todos_controller.rb:446:in `determine_down_count' /Volumes/miniStack/Users/emory/tracks-current/lib/source_view.rb:39:in `source_view' /Volumes/miniStack/Users/emory/tracks-current/app/controllers/todos_controller.rb:445:in `determine_down_count' /Volumes/miniStack/Users/emory/tracks-current/app/controllers/todos_controller.rb:543:in `render_todos_mobile' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:135:in `custom' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:167:in `respond' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:161:in `respond' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/mime_responds.rb:105:in `respond_to' /Volumes/miniStack/Users/emory/tracks-current/app/controllers/todos_controller.rb:18:in `index' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/base.rb:1101:in `perform_action_without_filters' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/filters.rb:696:in `call_filters' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/filters.rb:688:in `perform_action_without_benchmark' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue' /opt/local/lib/ruby/1.8/benchmark.rb:293:in `measure' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/benchmarking.rb:66:in `perform_action_without_rescue' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/rescue.rb:83:in `perform_action' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/base.rb:435:in `process_without_filters' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/filters.rb:684:in `process_without_session_management_support' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/session_management.rb:114:in `process' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/actionpack/lib/action_controller/base.rb:334:in `process'

snip

/opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:636:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:636:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:625:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:956:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel.rb:955:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/bin/mongrel_rails:127:in `run' /opt/local/lib/ruby/gems/1.8/gems/mongrel-0.3.13.3/lib/mongrel/command.rb:199:in `run'

snip

/Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in `require' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activesupport/lib/active_support/dependencies.rb:342:in `new_constants_in' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/activesupport/lib/active_support/dependencies.rb:495:in `require' /Volumes/miniStack/Users/emory/tracks-current/vendor/rails/railties/lib/commands/server.rb:39 /opt/local/lib/ruby/vendor_ruby/1.8/rubygems/custom_require.rb:27:in `require' script/server:3

END

SQLite, appears functional other than this, though i can make it generate an error message in the UI that appears to be in error. I can make Tracks tell me that there was a bug adding a task, but going to the project or Home reveals that it was created anyway.

Change History

05/05/08 23:49:21: Modified by emoryl at gmail.com

the error i can make it do when i'm adding a new event is this:

"An error occurred on the server." in the Web UI, but the log:

ActiveRecord?::StatementInvalid? (SQLite3::SQLException: near "DISTINCT": syntax error: SELECT count(DISTINCT todos.id) AS count_all FROM todos LEFT OUTER JOIN projects ON projects.id = todos.project_id LEFT OUTER JOIN contexts ON contexts.id = todos.context_id WHERE (todos.user_id = 1 and todos.state = 'active' and contexts.hide = 'f' AND (projects.state = 'active' OR todos.project_id IS NULL)) ORDER BY todos.due IS NULL, todos.due ASC, todos.created_at ASC ):

05/06/08 17:11:27: Modified by emoryl at gmail.com

  • keywords changed from mac osx tracks ruby bug report error to mac osx tracks ruby bug report error sqlite.
  • priority changed from normal to low.

so, while trying to duplicate this, I can do so on sqlite.

but when I move the database to MySQL, it works as designed.

i don't know if it is a problem with my sqlite binary/libraries/whatever, or with the standard dist. my test host is osx-ppc but can also test on osx-intel at a later date if necessary.

my instinct is to close this ticket since my problem is resolved by using mysql, but i am not sure why my sqlite test was breaking.

05/12/08 15:49:12: Modified by lrbalt

  • owner changed from bsag to lrbalt.

there is difficulty with postgresql and sqlite with DISTINCT so it is worth investigating a bit further. What revision of trunk are you running?

05/22/08 20:28:15: Modified by lrbalt

are you still having this problem on the latest trunk?

07/04/08 12:06:23: Modified by lrbalt

  • status changed from new to closed.
  • resolution set to invalid.

closing this. there were fixes in latest trunk / git for something similar. Please reopen if the issue still remains.