令人困惑的Ruby/MySQL错误:“无效的数据包:序列号不匹配"; [英] Perplexing Ruby/MySQL Error: "invalid packet: sequence number mismatch"

查看:64
本文介绍了令人困惑的Ruby/MySQL错误:“无效的数据包:序列号不匹配";的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Heroku上运行带有MySQL的Rails应用程序,这个错误使我完全困惑.如果我尝试选择一行,那么一切正常,如果我尝试选择少数几行,则通常会很好.但是,如果我尝试选择*甚至几十个/几百条记录,则会出现以下错误:

I'm running a Rails app with MySQL on Heroku and this error has me totally perplexed. Everything works fine if I try to select a single row, often if I try to select a handful. But if I try to select *, or even a few dozen/hundred records, I get the following error:

ActiveRecord::StatementInvalid: Mysql::ProtocolError: invalid packet: sequence number mismatch(52 != 29(expected)): SELECT  `people`.* FROM `people` LIMIT 30 OFFSET 10
/home/slugs/70bb5dad-9387-46c4-935d-cf74e70276a8/mnt/.bundle/gems/ruby/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract_adapter.rb:202:in `log'
/home/slugs/70bb5dad-9387-46c4-935d-cf74e70276a8/mnt/.bundle/gems/ruby/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/mysql_adapter.rb:289:in `execute'
/home/slugs/70bb5dad-9387-46c4-935d-cf74e70276a8/mnt/.bundle/gems/ruby/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/mysql_adapter.rb:619:in `select'
/home/slugs/70bb5dad-9387-46c4-935d-cf74e70276a8/mnt/.bundle/gems/ruby/1.8/gems/activerecord-3.0.3/lib/active_record/connection_adapters/abstract/database_statements.rb:7:in `select_all'

Running Rails 3,Ruby 1.8.6和MySQL 5.1.42.

Running Rails 3, Ruby 1.8.6, and MySQL 5.1.42.

我真是机智了,任何帮助将不胜感激!

I'm truly at my wit's end here, so any help would be greatly appreciated!

大卫

推荐答案

尝试与所有对象一起运行will_paginate时,它类似于ruby-mysql连接器中的错误,例如@ author.books.all.paginate(.. )

Looks similar to a bug in the ruby-mysql connector when you try and run will_paginate with all, such as @author.books.all.paginate(...)

https://github.com/tmtm/ruby-mysql/issues#第/8期

那里的快速修复方法是移回gem ruby​​-mysql 2.9.3

the quick fix there is to move back to gem ruby-mysql 2.9.3

在运行的任何mysql连接器gem中检查已知错误

Check for known bugs in whichever mysql connector gem you are running

这篇关于令人困惑的Ruby/MySQL错误:“无效的数据包:序列号不匹配";的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆