Right now ZG has a call to a MySQL dependent function to clear resultset at the end of _zeitgeist_block_latest function. Instead, the call should check for $db_type and call the proper handler instead. For example:

global $db_type;
switch ($db_type) {
	case 'mysql':
		mysql_free_result($q);
		break;
	case 'mysqli':
		mysqli_free_result($q);
		break;
	case 'pgsql':
		//TODO: What is pgsql function?
		break;
}

This code is tested and ready to commit, except for pgsql function...

Comments

fgm’s picture

Status: Needs review » Needs work

You're right, this needs to be fixed. However, we can't let it partly done. The PG function looks like it could be pg_free_result.

However, the best way would be to use a DB-independence function. It's a bit strange not to find a db_free_result or something like it in Drupal. Did we miss something ?

fgm’s picture

Status: Needs work » Fixed

Well, db_free_result doesn't seem to be existing or planned, so I've added it in here. It can be removed when/if core gets an implementation of this function someday.

Fix is included in today's version. Please try it.

Anonymous’s picture

Status: Fixed » Closed (fixed)
GabiAPF’s picture

For postgreSQL it should be: pg_free_result($q);