awesomemotive / WP-Mail-SMTP

The most popular WordPress SMTP and PHP Mailer plugin. Trusted by over 3 million sites.
https://wordpress.org/plugins/wp-mail-smtp/
GNU General Public License v3.0
55 stars 34 forks source link

Unknown Colum in where clause, error code 1054 #129

Open samjaninf opened 9 months ago

samjaninf commented 9 months ago

Expected Behavior

All the SQL queries should complete properly.

Not sure if this just my weird setup or what but I get an error in querymon. I got a similar error with a bit of php I was running (Cavalcade Runner) that utilized the double quotes instead of the single quotes in a query. I had to manually go in and change the query to put single quotes around the string and I also added the back tick around the column names in the where clause. So instead of:

SELECT COUNT(*)
FROM `wp_wpmailsmtp_debug_events`
WHERE event_type = 0
AND created_at >= "2023-11-18 09:26:37"

I changed it to something like:

SELECT COUNT(*)
FROM `wp_wpmailsmtp_debug_events`
WHERE event_type = 0
AND `created_at` >= '2023-11-18 09:26:37'

Current Behavior

Nothing disastrous so far, just one bug in query monitor when I go to the dashboard.

Possible Solution

Probably strictly adherence to the SQL language strictures. (Just change around a couple of quotes I think). I don't even know if this is relevant to you guys tbh. I never had these issues with MariaDB. And tbh, everything seems to be working properly as far as I can tell.

Steps to Reproduce

  1. Have a WP site on a mysql 8 instance.
  2. install wm-mail-smtp
  3. install querymon
  4. go to the back end dashboard

Screenshots

image