#263 ✓resolved
Camilo Lopez

DataObjects adaptor raises ArgumentError

Reported by Camilo Lopez | May 8th, 2008 @ 05:10 PM

When trying to access a resource using MySQL and there is a connection error ArgumentError is raised instead of the correspondent MySQL error.

Quick patch attached ( just removing an extra argument)

Comments and changes to this ticket

  • Sam Smoot

    Sam Smoot May 8th, 2008 @ 05:21 PM

    • Assigned user set to “Scott Bauer”

    Scott, PDI.

  • Scott Bauer

    Scott Bauer May 8th, 2008 @ 10:59 PM

    • State changed from “new” to “open”

    Camilo, can you give me a few more details? A stacktrace would be good. What happened to Mysql that caused the connection to be interrupted, and when did it occur? The patch you attached just comments out a "p se, sql", which shouldn't be there anyway :), is that what was causing the error in the first place?

  • Sam Smoot

    Sam Smoot May 8th, 2008 @ 11:27 PM

    • Milestone cleared.
  • Camilo Lopez

    Camilo Lopez May 9th, 2008 @ 08:35 AM


    I defined a DataMapper resource that uses the MySQL adapter

    class FooModel

    include DataMapper::Resource

    property :bar, String


    when I tried to

    FooModel.first :bar => 'abc'

    I got:


    `p': wrong number of arguments (2 for 1) (ArgumentError)
























    Instead of the :


    `execute_reader': Table 'camilo.foo_models' doesn't exist (MysqlError)

    I was expecting, I though that ArgumentError was misleading ;).

    On Thu, May 8, 2008 at 11:59 PM, Lighthouse


  • Scott Bauer

    Scott Bauer May 9th, 2008 @ 06:30 PM

    • State changed from “open” to “resolved”

    Ah, it was just the "p se, sql". Gotcha. Fixed: http://github.com/sam/dm-core/co...

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

People watching this ticket