My bot isn't responding to seen queries.

When a user named "Shiny" appears:
query: DELETE FROM bot_seen WHERE LOWER(nick) = "shiny" in /home/brenda/projects/drupal-5.1/includes/database.pgsql.inc on line 144
pg_query(): Query failed: ERROR: column "shiny" does not exist in /home/brenda/projects/drupal-5.1/includes/database.pgsql.inc on line 125.
query: INSERT INTO bot_seen (nick, channel, message, timestamp) VALUES ("Shiny", "#drupal", "gargi_bot: seen Sho", 1176765625) in /home/brenda/projects/drupal-5.1/includes/database.pgsql.inc on line 144.
pg_query(): Query failed: ERROR: column "Shiny" does not exist in /home/brenda/projects/drupal-5.1/includes/database.pgsql.inc on line 12

And during seen queries, e.g. "seen sho"
query: SELECT nick, channel, message, timestamp FROM bot_seen WHERE LOWER(nick) LIKE "sho" ORDER BY timestamp DESC in /home/brenda/projects/drupal-5.1/includes/database.pgsql.inc on line 144.

CommentFileSizeAuthor
#1 bot_seen.module.patch2.03 KBShiny
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Shiny’s picture

Assigned: Unassigned » Shiny
Status: Active » Needs review
FileSize
2.03 KB

the " quotes are not valid SQL -- maybe mysql lets you do that but postgres is picky, so drupal's database abstraction layer knows this and turns them into "

here's a patch to bot_seen, that changes these to single quotes

Shiny’s picture

p.s. there a " in the above bug report, but they didn't make it to display on this site.
the module was sending " in the SQL.

Morbus Iff’s picture

Status: Needs review » Fixed

This will be committed shortly.

Anonymous’s picture

Status: Fixed » Closed (fixed)