PostgreSQL-For-Wordpress / postgresql-for-wordpress

A maintained fork of https://wordpress.org/plugins/postgresql-for-wordpress/
GNU General Public License v2.0
209 stars 68 forks source link

Failed query (seems like it is coming from wordpress itself and not a plugin) #118

Open 0xFEEDC0DE64 opened 3 months ago

0xFEEDC0DE64 commented 3 months ago

WP Version: 6.5 PG4WP Version: latest master with some patches already

---------------------
[1713210572.6721] Error running :
SELECT SQL_CALC_FOUND_ROWS  wp_posts.ID
                                         FROM wp_posts
                                         WHERE 1=1  AND wp_posts.ID IN (123,124) AND wp_posts.post_type = 'attachment' AND ((wp_posts.post_status = 'inherit'))

                                         ORDER BY FIELD(wp_posts.ID,123,124)
                                         LIMIT 0, 100
---- converted to ----
SELECT   wp_posts."ID" , CASE wp_posts."ID" WHEN 123 THEN 1 WHEN 124 THEN 2 ELSE 0 END
                                         LIMIT 100 OFFSET 0
                                         FROM wp_posts
                                         WHERE 1=1  AND wp_posts."ID" IN (123,124) AND wp_posts.post_type = 'attachment' AND ((wp_posts.post_status = 'inherit'))

                                         ORDER BY CASE wp_posts."ID" WHEN 123 THEN 1 WHEN 124 THEN 2 ELSE 0 END
                                         LIMIT 100 OFFSET 0
----> FEHLER:  Syntaxfehler bei »FROM«
LINE 3:       FROM wp_posts
              ^
---------------------

I don't know what is going wrong here, and I don't know where that SELECT CASE is coming from