The primary table name must be in curly braces, otherwise there will be errors when table prefixes are used.

Comments

darren oh’s picture

Status: Active » Needs review
StatusFileSize
new832 bytes
dries’s picture

Status: Needs review » Fixed

Committed. Thanks.

darren oh’s picture

Status: Fixed » Patch (to be ported)

Applied to HEAD in CVS commit 84159.

patchnewbie’s picture

Assigned: Unassigned » patchnewbie

This would be a good patch for someone new to core development.

hazexp’s picture

StatusFileSize
new605 bytes

Patch ported to D6.

patchnewbie’s picture

Status: Patch (to be ported) » Needs review

Great! Marking for review.

fp’s picture

Status: Needs review » Reviewed & tested by the community

Tested - fantastic!

drumm’s picture

Status: Reviewed & tested by the community » Fixed

Committed to 5.x

darren oh’s picture

Fixed in CVS commit 87175.

gpk’s picture

Should similar changes also be made to _db_rewrite_sql() for consistency?

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

gpk’s picture

Version: 5.x-dev » 6.x-dev
Status: Closed (fixed) » Needs review
StatusFileSize
new1.93 KB

Actually it looks as though the patch at comment #1 got committed first to D6 (although it was intended for D5) then to D5 and the patch at #5 was never applied.

Here's another patch for D6 based on HEAD. It fixes a couple of excessively long lines in the phpdoc of db_rewrite_sql(), clarifies the instructions further, and does same for _db_rewrite_sql() also.

The doc. for http://api.drupal.org/api/function/hook_db_rewrite_sql should also be updated accordingly but I don't know how to do that!

gábor hojtsy’s picture

Status: Needs review » Fixed

Indeed, we mostly used table aliases but these were not documented. Thanks for the improvement.

gpk’s picture

Thanks Gábor.

(Commit #91420.)

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.