Download & Extend

Why use direct TRUNCATE instead of cache_clear_all() to clear Drupal cache?

Project:FlashVideo
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:attheshow
Status:closed (fixed)

Issue Summary

Why does the module use a direct TRUNCATE sql statement to clear the cache when performing postop, rather than using Drupal's provided API for clearing cache: cache_clear_all() ?

Aside from assuming too much about the structure of Drupal's cache table, a direct call to TRUNCATE will actually fail -- as I found out -- if you've properly set up your db to disallow TRUNCATE permission to the db user. (If someone hacks your Drupal site, you don't want to let them clean out entire tables, at least not with a single statement.)

Update in a future version?

Comments

#1

Version:6.x-1.5-rc2» 6.x-1.x-dev
Assigned to:Anonymous» attheshow
Status:active» fixed

Good point. Fixed in the development version.

#2

Status:fixed» closed (fixed)

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

nobody click here