The INSERT and UPDATE statements do not function in case of database with db_prefix.

Have to change the two statements in line 516 and 520, see patch attached. There is also an extra line in patch necessary.

PS: sorry for the patch format, I do not know the usual practice.

Comments

pwolanin’s picture

well, I'm a bit surprised that the original version doesn't work, but truthfully i've never tested it with a prefixed table. I'll look into this.

in terms of how to make a patch - you need diff or cvs. See: http://drupal.org/patch

pwolanin’s picture

Maybe be simpler to make a change from this:
db_query("INSERT INTO {$table} ("

to:

db_query("INSERT INTO {". $table ."} ("

pwolanin’s picture

StatusFileSize
new50 bytes

here's a patch

pwolanin’s picture

StatusFileSize
new1.97 KB

whoops - found an even more serious bug. an empty table name was being passed to db_next_id.

Note, this patch will break things unless you manually update the sequences table (under MySQL). Maybe I'll roll some update code.

pwolanin’s picture

Status: Needs review » Needs work
StatusFileSize
new3.91 KB

a more complete patch, but the update code doesn't seem quite right yet.

pwolanin’s picture

ah a bug with update_sql, perhaps. This patch should work.

pwolanin’s picture

StatusFileSize
new3.94 KB

patch...

pwolanin’s picture

Status: Needs work » Needs review

And this one should actually work. Please try it out.

pwolanin’s picture

StatusFileSize
new3.97 KB

hmmm, doing badly remembering to attach...

coupet’s picture

subscribing

pwolanin’s picture

Status: Needs review » Fixed

committed patch in #9

Anonymous’s picture

Status: Fixed » Closed (fixed)