which version is this cache_set function belong to? The function I have commented out is in Drupal 5.x and I've seen a lot. I　want to know which Drupal version the function I haven't commented out belongs. This is the function that I have seen on the site that I am working on. I am about to replace the site by Pressflow. But I met some problem with cache_set function. Serialized seems a new column and this function is so different. So I really don't know which version of Pressflow in 5.x that I can use for my site...

/*
function cache_set($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $headers = NULL) {
  $created = time();
  db_query("UPDATE {". $table. "} SET data = %b, created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $data, $created, $expire, $headers, $cid);
  if (!db_affected_rows()) {
   print_r($data);
    db_query("INSERT INTO {". $table. "} (cid, data, created, expire, headers) VALUES ('%s', %b, %d, %d, '%s')", $cid, $data, $created, $expire, $headers);
  }
   //mysql_query("INSERT INTO tbj_cache_views (cid, data,created, expire,headers) VALUES ('aaa', 'adsfadfasdfdffa', ".$created.", ".$expire.", NULL)");
}
*/
function cache_set($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $headers = NULL) {
  $serialized = 0;
  if (is_object($data) || is_array($data)) {
    $data = serialize($data);
    $serialized = 1;
  }
  db_lock_table($table);
  db_query("UPDATE {". $table ."} SET data = %b, created = %d, expire = %d, headers = '%s', serialized = %d WHERE cid = '%s'", $data, time(), $expire, $headers, $serialized, $cid);
  if (!db_affected_rows()) {
    @db_query("INSERT INTO {". $table ."} (cid, data, created, expire, headers, serialized) VALUES ('%s', %b, %d, %d, '%s', %d)", $cid, $data, time(), $expire, $headers, $serialized);
  }
  db_unlock_tables();
}
That looks like the D6 cache_set().

Pressflow versions are API compatible with the Drupal versions. So if your site is D5, you should use Pressflow 5.

Mixing up Drupal 5 and Drupal 6 code is a recipe for disaster. So if you are doing this stop. Pressflow 5 cache.inc includes this...

function cache_set($cid, $table = 'cache', $data, $expire = CACHE_PERMANENT, $headers = array()) {
  $headers = serialize($headers);
  $created = $_SERVER['REQUEST_TIME'];
  db_query("UPDATE {". $table. "} SET data = %b, created = %d, expire = %d, headers = '%s' WHERE cid = '%s'", $data, $created, $expire, $headers, $cid);
  if (!db_affected_rows()) {
    @db_query("INSERT INTO {". $table. "} (cid, data, created, expire, headers) VALUES ('%s', %b, %d, %d, '%s')", $cid, $data, $created, $expire, $headers);
  }
}


This is probably what you should use.