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
Comment #1
mikeytown2 commentedsolution?
http://api.drupal.org/api/function/update_sql/6#comment-412
Comment #2
mikeytown2 commentedComment #3
q0rban commentedsubscribe
Comment #4
mikeytown2 commentedfixed the advanced patch; needed to add in the functions to mysql as well.
Comment #6
tinker commentedRebuilt patch from base directory in the hope that it will be applied.
Comment #7
tinker commentedDon't know why it switch to ajax system? Switching to database update system.