#664 ✓resolved

No record update after upgrade to 0.9.7

Reported by Qubit | November 20th, 2008 @ 04:09 AM


i have a problem with dm after upgrade to version 0.9.7. Record with type "String" (varchar) will not be updated ("Text" no problem) -> "title" field no changes. Before the upgrade no problems (v0.9.6). I use do_mysql and mysql server: Server version: 5.0.32-Debian_7etch8-log Debian etch distribution

mysql> desc articles; +-----------+--------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-----------+--------------+------+-----+---------+----------------+ | id | int(11) | NO | PRI | NULL | auto_increment | | title | varchar(255) | YES | | NULL | | | content | text | YES | | NULL | | | notice_id | int(11) | YES | | NULL | | +-----------+--------------+------+-----+---------+----------------+

All utf-8.

mysql> SHOW VARIABLES LIKE 'character_set%'; +--------------------------+----------------------------+ | Variable_name | Value | +--------------------------+----------------------------+ | character_set_client | utf8 | | character_set_connection | utf8 | | character_set_database | utf8 | | character_set_filesystem | binary | | character_set_results | utf8 | | character_set_server | utf8 | | character_set_system | utf8 | | character_sets_dir | /usr/share/mysql/charsets/ | +--------------------------+----------------------------+

mysql> SHOW VARIABLES LIKE 'collation%'; +----------------------+-----------------+ | Variable_name | Value | +----------------------+-----------------+ | collation_connection | utf8_general_ci | | collation_database | utf8_general_ci | | collation_server | utf8_general_ci | +----------------------+-----------------+



dm-aggregates (0.9.7, 0.9.6) dm-core (0.9.7, 0.9.6) dm-migrations (0.9.7, 0.9.6) dm-optlock (0.1.2) dm-sweatshop (0.9.7, 0.9.6) dm-timestamps (0.9.7, 0.9.6) dm-types (0.9.7, 0.9.6) dm-validations (0.9.7, 0.9.6)

do_mysql (0.9.7, 0.9.6)

moreover: merb 1.0.1 ruby enterprise 1.8.6

Comments and changes to this ticket

  • Qubit

    Qubit November 21st, 2008 @ 01:48 PM

    For information:

    I have investigated the problem for method "update_attributes" with irb (merb -i) http://gist.github.com/27588

    So, update_attributes({'title' => 'title_new'} is okay

    update_attributes({'title' => 'title_1', 'content' => 'content_1'}) and update_attributes({'content' => 'content_2', 'title' => 'title_2'})

    failed for "title"

  • Qubit

    Qubit November 22nd, 2008 @ 03:22 AM


    i have performed a code review of commited changes in 0.9.7. The problem arise from this patch: http://github.com/sam/dm-core/co...

    If you rollback the changes (for @fields), then the problem do not arise, all fine :-)

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) November 22nd, 2008 @ 03:29 PM

    • State changed from “new” to “open”
    • Assigned user changed from “Sam Smoot” to “Dan Kubb (dkubb)”

    Qubit, do you mind putting together a failing spec with your problem? If you do that I'll look at either rolling back the commit that caused this, or find a solution that works in both cases.

  • Andre

    Andre November 23rd, 2008 @ 06:03 PM

    Hi, I sort of have the same problem after upgrading to 0.9.7. Since I first thought it was a merb related problem, I've posted my thoughts on the issue on their google group:


    Hope this can help, somehow!

  • Jan Kassens

    Jan Kassens November 24th, 2008 @ 09:04 AM

    #666 is likely related and has a small example (could easily converted to a spec, but i'm not sure about the location etc.

  • nitsujw

    nitsujw November 25th, 2008 @ 11:20 AM

    I just want to throw out there that I'm having the same problem here, update_attributes just won't save anything that is a varchar, but text fields work fine.

  • scottmotte

    scottmotte November 27th, 2008 @ 11:08 AM

    I can confirm that I am also having this issue.

    The strange thing is though, if I put the text field first, the varchar field and the text field saves?? But if the varchar field is first, the varchar will not save on update but the text field will save.

    See http://pastie.org/325428

  • Dale Campbell

    Dale Campbell November 28th, 2008 @ 12:32 AM

    Ditto. Same issue. In the pastie, the 'name' attribute is a String with :nullable => false.


  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) November 29th, 2008 @ 07:45 PM

    I just reverted the commit that caused this issue and created a spec to ensure it doesn't regress again.

    Would one (all?) of you mind installing edge dm-core (http://github.com/sam/dm-core/tr... and confirm that it is fixed now? I'd like to push out a new gem early next week if possible.

  • Dale Campbell

    Dale Campbell November 29th, 2008 @ 11:10 PM

    Yep, seems to be working for me. Thanks for jumping on this.

  • scottmotte

    scottmotte November 30th, 2008 @ 11:06 AM

    I can confirm that this is fixed. Thanks.

    (unless trying to install with "sudo gem install dm-core". I had to install from the github source with rake install).

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) November 30th, 2008 @ 12:11 PM

    scottmotte, right, that's good. I didn't want to release a gem until we were sure the problem was fixed on edge. It's my intention to only release gems if all known serious bugs are resolved.

    I will likely be releasing a new DataMapper gem early this week once the dm-tags gem conflict at Rubyforge is resolved, along with a couple of small misc issues.

    For now I am going to mark this ticket as resolved. If anyone installs dm-core from edge and this is still a problem for you please reply here and I'll re-open the ticket.

  • scottmotte

    scottmotte November 30th, 2008 @ 12:14 PM

    ok. i see. thanks again.

  • Dan Kubb (dkubb)

    Dan Kubb (dkubb) November 30th, 2008 @ 02:00 PM

    • State changed from “open” to “resolved”

    Marking this as resolved. Duplicate of #666 and #675

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 »

Referenced by