There is a mistake in the query of deleting comments and users in function function flag_content_comment and function flag_content_user, the mistake is wrong use of apostrophe around %s
the solution is changing the apostrophe into inverted commas
the correct query is: 'DELETE FROM {flag_content} WHERE eid = %d AND type = "%s"'

Comments

kbahey’s picture

Status: Active » Postponed (maintainer needs more info)

This is the correct SQL delimiter for char type. There is no problem with using '%s' at all.

Are you using PostgreSQL? What error are you getting that makes you think this is a problem.

morbus iff’s picture

Version: 5.x-2.5 » 6.x-1.x-dev
Assigned: chanifel » Unassigned
Status: Postponed (maintainer needs more info) » Active

The query is incorrect because it's using "eid" and not "fid".

morbus iff’s picture

Actually, I'm not really sure what's going on.
Your .install file uses fid and eid. Your DELETEs use eid.
But the generated table I get is:

+--------------+----------------------+------+-----+---------+----------------+
| Field        | Type                 | Null | Key | Default | Extra          |
+--------------+----------------------+------+-----+---------+----------------+
| fcid         | int(10) unsigned     | NO   | PRI | NULL    | auto_increment | 
| fid          | smallint(5) unsigned | NO   | MUL | 0       |                | 
| content_type | varchar(32)          | NO   | MUL |         |                | 
| content_id   | int(10) unsigned     | NO   |     | 0       |                | 
| uid          | int(10) unsigned     | NO   |     | 0       |                | 
| timestamp    | int(10) unsigned     | NO   |     | 0       |                | 
+--------------+----------------------+------+-----+---------+----------------+
morbus iff’s picture

This appears to be caused by Flag and Flag Content being installed at the same time.