Could you let me know which file and line specifically did you find that error?
Hi Nodesman, I reviewed the issue I was experiencing a bit further and found that the “to” column error I suspected was only a MySQL warning and not a critical error causing the queue’s insert statement to fail. The insert statement was still failing however, but for another reason. I found that the “wpr_queue” insert statement found in “lib/mail_functions.php” (line 64 of plugin version 3.5.2) was not providing the “sent” and “date” column values during the SQL insert statement. These columns are configured in the database to not allow null values. A default value is also not set for the columns and so the “wpr_queue” insert statement was failing since they were not provided.
I am not sure if the “wpr_queue” table previously allowed null values for the “sent” and “date” columns, or if they contained a default field value originally, but during my testing they did not. Maybe something changed during the update process to MySQL 5.6 on my server, or maybe my previous MySQL 5.5 was allowing insert statements it should not have been.
To correct the problem I was experiencing, I updated the SQL insert statement on line 64 of the “lib/mail_functions.php” file and provided “sent” and “date” values. This corrected the problem and my queue is now processing and messages are flowing properly.
If you have questions, please let me know. Also, thank you for your great development!
Thanks for pointing this out. There were a few columns that were previously present but currently aren’t present in the new version. Given their original definition they would need to be manually dropped to accommodate the newer table structure. I’ll fix this in one of the next few versions. In the meanwhile I recommend you find other such columns and change them to allow null.
In the case of the sent column the default value should be 0 and not null so I suggest you make such a change. Also please post/point me to the erroneous query.
Thank you for your response. The erroneous query was the MySQL statement being created on line 64 of the “lib/mail_functions.php” file (plugin version 3.5.2). The original line was:
$query = "INSERT INTO $tableName (from,fromname,to,reply_to,subject,htmlbody,textbody,headers,attachimages,htmlenabled,email_type,delivery_type,meta_key,hash,sid) values ('$from','$fromname','$to','$reply_to','$subject','$htmlbody','$textbody','$headers','$attachImages','$htmlenabled','$email_type','$delivery_type','$meta_key','$hash','$sid');";
I updated the statement above to include “sent” and “date” values as discussed.
I suggest you add tilds around every single column name to escape it. That should fix the issue with the reserved keyword issue.