Skip to content
This repository was archived by the owner on Sep 11, 2026. It is now read-only.

Commit 2d1d5dd

Browse files
authored
Merge upstream trunk into d1-support
Automated upstream sync (#6).
2 parents 1b532ab + 47f9d31 commit 2d1d5dd

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎packages/mysql-on-sqlite/src/sqlite/class-wp-sqlite-pdo-user-defined-functions.php‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -830,7 +830,7 @@ public function inet_ntoa( $num ) {
830830
* @return int long integer
831831
*/
832832
public function inet_aton( $addr ) {
833-
return absint( ip2long( $addr ) );
833+
return abs( (int) ip2long( $addr ) );
834834
}
835835

836836
/**

‎packages/mysql-on-sqlite/tests/WP_MySQL_On_SQLite_PDO_API_Tests.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,12 @@ public function test_query(): void {
406406
}
407407
}
408408

409+
public function test_inet_aton(): void {
410+
$result = $this->driver->query( "SELECT INET_ATON('1.2.3.4')" );
411+
412+
$this->assertSame( '16909060', $result->fetchColumn() );
413+
}
414+
409415
public function test_statement_query_string(): void {
410416
$query = 'SELECT 1 AS value';
411417
$stmt = $this->driver->query( $query );

0 commit comments

Comments
 (0)