Skip to content

Bundled SQLite for Windows is missing math functions #24758

Closed

Description

@mvorisek

Description

The following code:

<?php

$db = new PDO('sqlite::memory:');

$sth = $db->prepare('SELECT sqrt(null) foo');
$sth->execute();

$result = $sth->fetch(PDO::FETCH_ASSOC);
var_dump($result);

Resulted in this output:

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 1 no such function: sqrt 

But I expected this output instead:

array(1) {
  ["foo"]=>
  NULL
}

download source: https://www.php.net/downloads.php?os=windows

In older official PHP 7.4 download with SQLite 3.45.1 this was working. The new bundled version is 3.53.4. There needs to be some build regression.

PHP Version

PHP 8.5.12 (cli) (built: Oct 26 2026 09:51:07) (NTS Visual C++ 2022 x64)
Copyright (c) The PHP Group
Built by The PHP Group
Zend Engine v4.5.12, Copyright (c) Zend Technologies
    with Zend OPcache v8.5.12, Copyright (c), by Zend Technologies

Operating System

windows

Activity

  1. mvorisek commented on Oct 26, 2026

    @mvorisek
    ContributorAuthor

    The bundled version should be the same as officially offered by SQLite - https://www.sqlite.org/download.html

    Image

    when the official dll from SQLite web (and larger in size) is used, the math functions are available

  2. shivammathur commented on Oct 27, 2026

    @shivammathur
    Member

    Fixed in winlibs/sqlite3@05dd5bd.

    @mvorisek Please test with this sqlite3 3.54.1 build for PHP 8.5.

  3. mvorisek commented on Oct 28, 2026

    @mvorisek
    ContributorAuthor

    I have tested the dll from the mentioned .zip and it fixes this issue on Windows. If this can be landed into the lower supported php versions please do so. Thank you!

  4. mvorisek commented on Oct 29, 2026

    @mvorisek
    ContributorAuthor

    closing as fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions