{"id":16038267,"url":"https://github.com/byroot/rails-explain-bug","last_synced_at":"2025-10-20T01:41:12.468Z","repository":{"id":6003299,"uuid":"7226353","full_name":"byroot/rails-explain-bug","owner":"byroot","description":"Minimal app to highlight a rails bug https://github.com/rails/rails/issues/8541","archived":false,"fork":false,"pushed_at":"2012-12-18T16:17:04.000Z","size":128,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-01-21T03:25:07.924Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/byroot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-12-18T16:16:51.000Z","updated_at":"2013-12-14T01:09:04.000Z","dependencies_parsed_at":"2022-08-31T00:11:55.818Z","dependency_job_id":null,"html_url":"https://github.com/byroot/rails-explain-bug","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byroot%2Frails-explain-bug","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byroot%2Frails-explain-bug/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byroot%2Frails-explain-bug/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/byroot%2Frails-explain-bug/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/byroot","download_url":"https://codeload.github.com/byroot/rails-explain-bug/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243551230,"owners_count":20309291,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-08T22:41:05.404Z","updated_at":"2025-10-20T01:41:12.371Z","avatar_url":"https://github.com/byroot.png","language":"Ruby","readme":"To reproduce the bug\n\n```\n\u003e\u003e Foo.create(name: 'foo')\n\u003e\u003e Foo.first\n\n  Foo Load (0.3ms)  SELECT `foos`.* FROM `foos` LIMIT 1\n   (0.4ms)  BEGIN\n   (0.3ms)  UPDATE `foos` SET `name` = 'blahblahblahblah', `updated_at` = '2012-12-18 16:14:51' WHERE `foos`.`id` = 1\n   (25.8ms)  COMMIT\n  EXPLAIN (0.3ms)  EXPLAIN SELECT `foos`.* FROM `foos` LIMIT 1\n  EXPLAIN (0.3ms)  EXPLAIN UPDATE `foos` SET `name` = 'blahblahblahblah', `updated_at` = '2012-12-18 16:14:51' WHERE `foos`.`id` = 1\nMysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE `foos` SET `name` = 'blahblahblahblah', `updated_at` = '2012-12-18 16:14:' at line 1: EXPLAIN UPDATE `foos` SET `name` = 'blahblahblahblah', `updated_at` = '2012-12-18 16:14:51' WHERE `foos`.`id` = 1\nActiveRecord::StatementInvalid: Mysql2::Error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'UPDATE `foos` SET `name` = 'blahblahblahblah', `updated_at` = '2012-12-18 16:14:' at line 1: EXPLAIN UPDATE `foos` SET `name` = 'blahblahblahblah', `updated_at` = '2012-12-18 16:14:51' WHERE `foos`.`id` = 1\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `query'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `block in execute'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract_adapter.rb:280:in `block in log'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activesupport-3.2.9/lib/active_support/notifications/instrumenter.rb:20:in `instrument'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract_adapter.rb:275:in `log'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/connection_adapters/abstract_mysql_adapter.rb:245:in `execute'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/connection_adapters/mysql2_adapter.rb:211:in `execute'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/connection_adapters/mysql2_adapter.rb:215:in `exec_query'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/connection_adapters/mysql2_adapter.rb:100:in `explain'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/explain.rb:65:in `block (2 levels) in exec_explain'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/explain.rb:59:in `tap'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/explain.rb:59:in `block in exec_explain'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/explain.rb:58:in `map'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/explain.rb:58:in `exec_explain'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/explain.rb:34:in `logging_query_plan'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/relation.rb:159:in `to_a'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/relation/finder_methods.rb:378:in `find_first'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/relation/finder_methods.rb:122:in `first'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/activerecord-3.2.9/lib/active_record/querying.rb:5:in `first'\n\tfrom (irb):1\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/commands/console.rb:47:in `start'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/commands/console.rb:8:in `start'\n\tfrom /Users/byroot/.rvm/gems/ruby-1.9.3-p327/gems/railties-3.2.9/lib/rails/commands.rb:41:in `\u003ctop (required)\u003e'\n\tfrom script/rails:6:in `require'\n\tfrom script/rails:6:in `\u003cmain\u003e'\n\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyroot%2Frails-explain-bug","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbyroot%2Frails-explain-bug","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbyroot%2Frails-explain-bug/lists"}