File tree 2 files changed +26
-0
lines changed
2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ PDO_sqlite: Testing empty filename
3
+ --EXTENSIONS--
4
+ pdo_sqlite
5
+ --FILE--
6
+ <?php
7
+
8
+ // create with empty filename
9
+ $ db = new PDO ('sqlite: ' );
10
+
11
+ var_dump ($ db ->exec ('CREATE TABLE test1 (id INT); ' ));
12
+
13
+ // create with empty URI
14
+ $ db = new PDO ('sqlite:file:?cache=shared ' );
15
+
16
+ var_dump ($ db ->exec ('CREATE TABLE test1 (id INT); ' ));
17
+ ?>
18
+ --EXPECT--
19
+ int(0)
20
+ int(0)
Original file line number Diff line number Diff line change @@ -5,6 +5,11 @@ pdo_sqlite
5
5
--FILE--
6
6
<?php
7
7
8
+ // create with in-memory database
9
+ $ db = new PDO ('sqlite:file::memory:?cache=shared ' );
10
+
11
+ var_dump ($ db ->exec ('CREATE TABLE test1 (id INT); ' ));
12
+
8
13
// create with default read-write|create mode
9
14
$ filename = "file: " . __DIR__ . DIRECTORY_SEPARATOR . "pdo_sqlite_filename_uri.db " ;
10
15
@@ -29,6 +34,7 @@ if (file_exists($filename)) {
29
34
?>
30
35
--EXPECTF--
31
36
int(0)
37
+ int(0)
32
38
33
39
Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in %s
34
40
Stack trace:
You can’t perform that action at this time.
0 commit comments