Re: com php-src: add test for bug #73068: ext/sqlite3/tests/bug73068.phpt
| From: | Christoph M. Becker | Date: | Tue, 13 Sep 2016 13:45:06 +0000 |
| Subject: | Re: com php-src: add test for bug #73068: ext/sqlite3/tests/bug73068.phpt | ||
| References: | 1 | Groups: | php.cvs |
| Request: | Send a blank email to php-cvs+get-94478@lists.php.net to get a copy of this message | ||
On 13.09.2016 at 15:28, Anatol Belski wrote:
> Commit: 248f8c3a91ce28d2d7b1096e6b381ba9029896db
> Author: Anatol Belski <ab@php.net> Tue, 13 Sep 2016 15:28:28 +0200
> Parents: fc31d6fed4ce4e58bf46204a31d4441684722c81
> Branches: PHP-5.6 PHP-7.0 PHP-7.1 master
>
> Link:
> http://git.php.net/?p=php-src.git;a=commitdiff;h=248f8c3a91ce28d2d7b1096e6b381ba9029896db
>
> Log:
> add test for bug #73068
>
> Bugs:
> https://bugs.php.net/73068
>
> Changed paths:
> A ext/sqlite3/tests/bug73068.phpt
>
>
> Diff:
> diff --git a/ext/sqlite3/tests/bug73068.phpt b/ext/sqlite3/tests/bug73068.phpt
> new file mode 100644
> index 0000000..f3a05d7
> --- /dev/null
> +++ b/ext/sqlite3/tests/bug73068.phpt
> @@ -0,0 +1,37 @@
> +--TEST--
> +Bug #73068 SQLite3 may fail to DELETE
> +--SKIPIF--
> +<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?>
> +--FILE--
This test is supposed to fail for SQLite 3.11.0 - 3.14.1, so with regard
to system libsqlite3 there should be a respective handler in the SKIPIF
section. I'm not sure, if that would fit well with distros, which might
backport the bugfix.
Cheers!
> +<?php
> +
> +$db = new \SQLite3(':memory:') ;
> +
> +$db->exec("CREATE TABLE IF NOT EXISTS t1(a INT UNIQUE, b INT)");
> +$db->exec("INSERT OR REPLACE INTO t1(a,b) VALUES('1','2')");
> +
> +$r = $db->query("SELECT * FROM t1 WHERE a='1' AND b='2'");
> +var_dump($r->fetchArray());
> +
> +$db->exec("DELETE FROM t1 WHERE a='1' AND b='2'");
> +
> +$r = $db->query("SELECT * FROM t1;");
> +var_dump($r->fetchArray());
> +
> +$db->close();
> +
> +?>
> +==OK==
> +--EXPECT--
> +array(4) {
> + [0]=>
> + int(1)
> + ["a"]=>
> + int(1)
> + [1]=>
> + int(2)
> + ["b"]=>
> + int(2)
> +}
> +bool(false)
> +==OK==
>