Database Test

This is the table definition (click on images to see them full-sized):

Here’s the data:

Here’s me with a WHERE clause that says MYDATE=current_date():

Note that one row is returned, as expected, since today is 8th January. Now I modify the WHERE clause to add one character (“>”):

Having saved the revised publication, a new click of the ‘Test’ button shows zero rows being returned. Given the data, it ought to be showing 2 rows (ids=2 and 3).

Here’s the equivalent test run directly on the MySQL (well, MariaDB, but it amounts to the same thing!) back-end:

MariaDB [wordpress]> select * from datestest;
+------+------------+
| col1 | mydate |
+------+------------+
| 1 | 2020-01-04 |
| 2 | 2020-01-08 |
| 3 | 2020-01-15 |
+------+------------+
3 rows in set (0.000 sec)

MariaDB [wordpress]> select * from datestest where mydate=current_date();
+------+------------+
| col1 | mydate |
+------+------------+
| 2 | 2020-01-08 |
+------+------------+
1 row in set (0.000 sec)

MariaDB [wordpress]> select * from datestest where mydate>=current_date();
+------+------------+
| col1 | mydate |
+------+------------+
| 2 | 2020-01-08 |
| 3 | 2020-01-15 |
+------+------------+
2 rows in set (0.000 sec)