Skip to content

Sqlite ATTACH is crashing php when the filename is bind /w open_basedir set #9032

Closed
@mvorisek

Description

@mvorisek

Description

The following code:

<?php

$db = new \PDO("sqlite::memory:");
$db->setAttribute(\PDO::ATTR_ERRMODE, \PDO::ERRMODE_EXCEPTION);

$db->exec('attach database \':memory:\' AS "db1"');
var_dump($db->exec('create table db1.r (id int)'));

$st = $db->prepare('attach database :a AS "db2"');
$st->execute([':a' => ':memory:']);
var_dump($db->exec('create table db2.r (id int)'));

demo: https://3v4l.org/Su8lK

Resulted in this output:

int(0)

Process exited with code 139.

But I expected this output instead:

int(0)
int(0)

PHP Version

any

Operating System

any

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions