Req #79433 [Opn->Csd]: Update sqlite3 to support generated columns (3.31)
| From: | cmb@php.net | Date: | Mon, 30 Mar 2020 11:19:45 +0000 |
| Subject: | Req #79433 [Opn->Csd]: Update sqlite3 to support generated columns (3.31) | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-226339@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=79433&edit=1
ID: 79433
Updated by: cmb@php.net
Reported by: l33tengineer at gmail dot com
Summary: Update sqlite3 to support generated columns (3.31)
-Status: Open
+Status: Closed
Type: Feature/Change Request
Package: PDO SQLite
Operating System: debian linux
PHP Version: 7.4.4
-Assigned To:
+Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
As of PHP 7.4.0, libsqlite3 is no longer bundled, so this request
makes no sense. You just have to compile PHP with a recent
libsqlite3.
Previous Comments:
------------------------------------------------------------------------
[2020-03-30 10:48:21] l33tengineer at gmail dot com
Description:
------------
Generated column support was added with SQLite version 3.31.0 (2020-01-22).
Php does not yet support this version and with it the generated column syntax.
I'd like to propose an update to the sqlite extension to allow for the generated column syntax
as described in https://sqlite.org/gencol.html.
Creating an (in-memory) sqlite database with
GENERATED ALWAYS AS sql now gives a syntax
error.
Test script:
---------------
<?php
$db = new \PDO('sqlite::memory:');
$sql = <<<SQL
CREATE TABLE t1(
a INTEGER PRIMARY KEY,
b INT,
c TEXT,
d INT GENERATED ALWAYS AS (a*abs(b)) VIRTUAL,
e TEXT GENERATED ALWAYS AS (substr(c,b,b+1)) STORED
);
SQL;
$result = $db->exec($sql);
var_dump($result);
var_dump($db->errorInfo());
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=79433&edit=1