Skip to content

[Stale Issue] WP comment_approved column is varchar and WP expects to be able to check it against an int.  #14

@omontigny

Description

@omontigny

Hi

WP_version : 4.9.6

I have a little problem with comments count :

pg_query(): Query failed: ERROR: operator does not exist: character varying = integer LINE 1: ...wp_comments WHERE user_id = 5 AND comment_approved = 1 ^ HINT: No operator matches the given name and argument type(s). You might need to add explicit type casts. in driver_pgsql.php on line 139

The value of comment_approved has to be cast but i didn't find how to do that.
good syntax is : SELECT COUNT(*) FROM wp_comments WHERE user_id = 5 AND comment_approved = '1'

Thank you in advance for your help.

Best regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions