I just lost way more time than I would've liked on this.

I have an array, which when serialized looks like this:

a:1:{s:6:"groups";a:1:{i:2237;s:4:"2237";}}

However, when passed into update_sql(), it gets turned into this:

a:1:s:6:"groups";a:1:i:2237;s:4:"2237";

This is of course meaningless and causes the data when unserialized again to be invalid. A workaround is to use db_query() instead, but then you can't see the query in the list of those that have run.

Thankfully, this god-awful function is finally gone in D7, so this is only an issue in D5 and D6. I figure this might be a duplicate of an existing bug, since there seem to be blog posts documenting the problem, but I didn't find any in searching.

Comments

mikeytown2’s picture

mikeytown2’s picture

Status: Active » Needs review
StatusFileSize
new1.51 KB
new3.23 KB
q0rban’s picture

subscribe

mikeytown2’s picture

StatusFileSize
new4.86 KB

fixed the advanced patch; needed to add in the functions to mysql as well.

Status: Needs review » Needs work

The last submitted patch, drupal-667714-advanced.patch, failed testing.

tinker’s picture

Component: update system » ajax system
Status: Needs work » Needs review
StatusFileSize
new4.23 KB

Rebuilt patch from base directory in the hope that it will be applied.

tinker’s picture

Component: ajax system » database update system

Don't know why it switch to ajax system? Switching to database update system.

Status: Needs review » Closed (outdated)

Automatically closed because Drupal 6 is no longer supported. If the issue verifiably applies to later versions, please reopen with details and update the version.