INSERT and UPDATE does not work with prefixed database names
doka - July 13, 2007 - 12:32
| Project: | Object driver |
| Version: | 5.x-1.0-beta |
| Component: | Code |
| Category: | bug report |
| Priority: | critical |
| Assigned: | Unassigned |
| Status: | closed |
Description
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.
| Attachment | Size |
|---|---|
| patch_to_insert_update_prefix_bug.txt | 1.15 KB |

#1
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
#2
Maybe be simpler to make a change from this:
db_query("INSERT INTO {$table} ("to:
db_query("INSERT INTO {". $table ."} ("#3
here's a patch
#4
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.
#5
a more complete patch, but the update code doesn't seem quite right yet.
#6
ah a bug with update_sql, perhaps. This patch should work.
#7
patch...
#8
And this one should actually work. Please try it out.
#9
hmmm, doing badly remembering to attach...
#10
subscribing
#11
committed patch in #9
#12