Closed (fixed)
Project:
Drupal core
Version:
6.x-dev
Component:
base system
Priority:
Critical
Category:
Bug report
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
25 Nov 2009 at 22:34 UTC
Updated:
3 Jan 2014 at 00:29 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
hass commentedFound another place in update.module that could better use TRUNCATE.
Comment #2
hass commentedNot that I care much about D5 any longer, but here is a patch if you'd like to commit.
Comment #3
hass commentedComment #4
hass commented~2 seconds for clearing all monster caches... this is such a great boost - you can really feel it - everywhere a full cache clear is executed - and this happens often in Drupal modules!
This patch is sooo trivial... I could simply set it RTBC myself... this are backports of #452936: Use db_truncate() in cache_clear_all()
Comment #5
gábor hojtsy1. Let's verify this works in the supported database engines. Since TRUNCATE is not part of any SQL standard. http://www.postgresql.org/docs/8.1/static/sql-truncate.html looks to support it but we need to look back to as much in versions as we support.
2. Fixes go first to Drupal 7.
3. Please do not RTBC your own patches.
Comment #6
hass commentedThis has already been implemented in D7 some months ago (see #4)... with
db_truncate()andTRUNCATE TABLE {table}works 100% with PgSQL and MySQL - only SQLite requires some special handling. Therefore we are fine in D6 and D5 to use it as is.Comment #7
gábor hojtsyThat it works in D7 databases doe not mean it works in D6 databases. D6 and D5 has different DB requirements, and we need to check according to that.
Comment #8
hass commentedOk, looking though the database servers documentation:
MySQL 4.1: http://dev.mysql.com/doc/refman/4.1/en/truncate-table.html looks working.
PgSQL 7.4: http://www.postgresql.org/docs/7.4/interactive/sql-truncate.html looks also working.
Do we need to test every version up to the current to verify?
Comment #9
damien tournoud commentedTRUNCATE is supported by both MySQL and PostgreSQL on versions we support on D6. Looks good to go.
But @hass: never *ever* mark as RTBC your own patches again.
Comment #10
hass commented*Sry*
Comment #11
gábor hojtsyCommitted to Drupal 6, thanks.