From e36bf798980f9e722260f56832e3883c4617ecad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jake=C5=A1?= Date: Mon, 13 Jul 2026 10:34:28 +0200 Subject: [PATCH 1/3] Test against WordPress 7.0.1 Update the WordPress test environment and remove the Site Health failure that no longer occurs. Track the three comment-check failures exposed by the driver's existing UPDATE row-count mismatch. Correct changed-row reporting is separate compatibility work. --- .github/workflows/wp-tests-phpunit-run.js | 4 +++- composer.json | 2 +- wp-setup.sh | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wp-tests-phpunit-run.js b/.github/workflows/wp-tests-phpunit-run.js index ae4f5f6a3..5a376aa71 100644 --- a/.github/workflows/wp-tests-phpunit-run.js +++ b/.github/workflows/wp-tests-phpunit-run.js @@ -17,10 +17,12 @@ const expectedErrors = [ ]; const expectedFailures = [ - 'Tests_Admin_wpSiteHealth::test_object_cache_thresholds with data set #2', 'Tests_Admin_wpSiteHealth::test_object_cache_thresholds with data set #3', 'Tests_Comment::test_wp_new_comment_respects_comment_field_lengths', 'Tests_Comment::test_wp_update_comment', + 'Tests_Comment_CheckComment::test_should_return_false_when_comment_previously_approved_is_enabled_and_author_does_not_have_approved_comment', + 'Tests_Comment_CheckComment::test_should_return_true_when_comment_previously_approved_is_enabled_and_author_has_approved_comment', + 'Tests_Comment_CheckComment::test_should_return_false_when_comment_previously_approved_is_enabled_and_user_does_not_have_a_previously_approved_comment_with_any_email', 'Tests_DB_Charset::test_get_column_charset with data set #0', 'Tests_DB_Charset::test_get_column_charset with data set #1', 'Tests_DB_Charset::test_get_column_charset with data set #2', diff --git a/composer.json b/composer.json index 689b44ed7..aba4026a3 100644 --- a/composer.json +++ b/composer.json @@ -62,7 +62,7 @@ "wp-test-ensure-env": [ "if [ ! -f wordpress/src/wp-load.php ]; then composer run wp-setup; fi", "@putenv COMPOSE_IGNORE_ORPHANS=true", - "cd wordpress && if [ -z \"$(node tools/local-env/scripts/docker.js ps -q)\" ]; then cd ..; composer run wp-test-start; fi" + "cd wordpress && if [ -z \"$(DOTENV_CONFIG_QUIET=true node tools/local-env/scripts/docker.js ps -q)\" ]; then cd ..; composer run wp-test-start; fi" ], "wp-test-php": [ "@wp-test-ensure-env @no_additional_args", diff --git a/wp-setup.sh b/wp-setup.sh index 0e4321010..6e60e4753 100755 --- a/wp-setup.sh +++ b/wp-setup.sh @@ -8,7 +8,7 @@ set -e -WP_VERSION="6.7.2" +WP_VERSION="7.0.1" DIR="$(dirname "$0")" WP_DIR="$DIR/wordpress" From f83308aaa24100b7ac44bf26079b6a37de084507 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jake=C5=A1?= Date: Mon, 13 Jul 2026 10:35:20 +0200 Subject: [PATCH 2/3] Normalize non-padded temporal literals WordPress 6.8 changed get_calendar() to generate date bounds with integer month components, producing literals such as '2026-2-01'. MySQL treats those values as dates, while SQLite compares the stored values as text. Normalize non-padded temporal components so calendar queries continue to work after moving the test environment from WordPress 6.7.2 to 7.0.1. --- .github/workflows/wp-tests-phpunit-run.js | 1 - .../sqlite/class-wp-pdo-mysql-on-sqlite.php | 33 +++++++++++++++---- .../tests/WP_SQLite_Driver_Tests.php | 14 ++++++++ 3 files changed, 41 insertions(+), 7 deletions(-) diff --git a/.github/workflows/wp-tests-phpunit-run.js b/.github/workflows/wp-tests-phpunit-run.js index 5a376aa71..527508607 100644 --- a/.github/workflows/wp-tests-phpunit-run.js +++ b/.github/workflows/wp-tests-phpunit-run.js @@ -89,7 +89,6 @@ const expectedFailures = [ 'Tests_Menu_Walker_Nav_Menu::test_start_el_with_empty_attributes with data set #6', 'Tests_Menu_Walker_Nav_Menu::test_start_el_with_empty_attributes with data set #7', 'Tests_Menu_wpNavMenu::test_wp_nav_menu_should_not_have_has_children_class_with_custom_depth', - 'WP_Test_REST_Posts_Controller::test_get_items_orderby_modified_query', ]; console.log( 'Running WordPress PHPUnit tests with expected failures tracking...' ); diff --git a/packages/mysql-on-sqlite/src/sqlite/class-wp-pdo-mysql-on-sqlite.php b/packages/mysql-on-sqlite/src/sqlite/class-wp-pdo-mysql-on-sqlite.php index cdb8698ee..cdf6f581d 100644 --- a/packages/mysql-on-sqlite/src/sqlite/class-wp-pdo-mysql-on-sqlite.php +++ b/packages/mysql-on-sqlite/src/sqlite/class-wp-pdo-mysql-on-sqlite.php @@ -4073,10 +4073,10 @@ private function translate_string_literal( WP_Parser_Node $node ): string { /* * Translate datetime literals. * - * Process only strings that could possibly represent a datetime - * literal ("YYYY-MM-DDTHH:MM:SS", "YYYY-MM-DDTHH:MM:SSZ", etc.). + * Process only strings that could possibly represent a date or datetime + * literal ("YYYY-M-D", "YYYY-MM-DDTHH:MM:SSZ", etc.). */ - if ( strlen( $value ) >= 19 && is_numeric( $value[0] ) ) { + if ( strlen( $value ) >= 8 && is_numeric( $value[0] ) ) { $value = $this->translate_datetime_literal( $value ); } @@ -4681,7 +4681,11 @@ private function translate_function_call( WP_Parser_Node $node ): string { */ private function translate_datetime_literal( string $value ): string { /* - * The code below converts the date format to one preferred by SQLite. + * Normalize MySQL date and datetime literals for SQLite. + * + * MySQL accepts date and time components without zero padding. SQLite + * stores temporal values as text, so they must be normalized for lexical + * comparisons and SQLite date functions to work correctly. * * MySQL accepts ISO 8601 date strings: 'YYYY-MM-DDTHH:MM:SSZ' * SQLite prefers a slightly different format: 'YYYY-MM-DD HH:MM:SS' @@ -4704,8 +4708,25 @@ private function translate_datetime_literal( string $value ): string { * which is true in the unit test suite, but there could also be a timezone offset * like "+00:00" or "+01:00". We could add support for that later if needed. */ - if ( 1 === preg_match( '/^(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})Z$/', $value, $matches ) ) { - $value = $matches[1] . ' ' . $matches[2]; + if ( + 1 === preg_match( + '/^(\d{4})-(\d{1,2})-(\d{1,2})(?:([ T])(\d{1,2}):(\d{1,2}):(\d{1,2})(Z)?)?$/', + $value, + $matches + ) + ) { + $value = sprintf( '%04d-%02d-%02d', $matches[1], $matches[2], $matches[3] ); + if ( isset( $matches[4] ) && '' !== $matches[4] ) { + $is_iso_8601 = 'T' === $matches[4] && 'Z' === ( $matches[8] ?? '' ); + $value .= sprintf( + '%s%02d:%02d:%02d%s', + $is_iso_8601 ? ' ' : $matches[4], + $matches[5], + $matches[6], + $matches[7], + $is_iso_8601 ? '' : ( $matches[8] ?? '' ) + ); + } } /* diff --git a/packages/mysql-on-sqlite/tests/WP_SQLite_Driver_Tests.php b/packages/mysql-on-sqlite/tests/WP_SQLite_Driver_Tests.php index 942d30100..bad5f6dab 100644 --- a/packages/mysql-on-sqlite/tests/WP_SQLite_Driver_Tests.php +++ b/packages/mysql-on-sqlite/tests/WP_SQLite_Driver_Tests.php @@ -2963,6 +2963,20 @@ public function testSelectFilterByDatesGtLt() { $this->assertEquals( 'second', $results[0]->option_name ); } + public function testSelectFilterByNonPaddedDates() { + $this->assertQuery( "INSERT INTO _dates (option_name, option_value) VALUES ('first', '2025-02-01 12:00:00');" ); + $this->assertQuery( "INSERT INTO _dates (option_name, option_value) VALUES ('second', '2025-03-01 12:00:00');" ); + + $this->assertQuery( + "SELECT * FROM _dates + WHERE option_value >= '2025-2-01 0:0:0' + AND option_value <= '2025-2-28 23:59:59'" + ); + $results = $this->engine->get_query_results(); + $this->assertCount( 1, $results ); + $this->assertEquals( 'first', $results[0]->option_name ); + } + public function testSelectFilterByDatesZeroHour() { $this->assertQuery( "INSERT INTO _dates (option_name, option_value) VALUES ('first', '2014-10-21 00:42:29');" ); $this->assertQuery( "INSERT INTO _dates (option_name, option_value) VALUES ('second', '2014-10-21 01:42:29');" ); From 217fbe8811b80fd523490e592a3abf2cabbd3b59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Jake=C5=A1?= Date: Mon, 13 Jul 2026 10:35:23 +0200 Subject: [PATCH 3/3] Mark WordPress 7.0 as tested --- packages/plugin-sqlite-database-integration/readme.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/plugin-sqlite-database-integration/readme.txt b/packages/plugin-sqlite-database-integration/readme.txt index 8f6f1372d..d19a6521c 100644 --- a/packages/plugin-sqlite-database-integration/readme.txt +++ b/packages/plugin-sqlite-database-integration/readme.txt @@ -2,7 +2,7 @@ Contributors: wordpressdotorg, aristath, janjakes, zieladam, berislav.grgicak, bpayton, zaerl Requires at least: 6.4 -Tested up to: 6.9 +Tested up to: 7.0 Requires PHP: 7.2 Stable tag: 3.0.0-rc.7 License: GPLv2 or later