summaryrefslogtreecommitdiff
path: root/ext/pdo_sqlite/tests
diff options
context:
space:
mode:
Diffstat (limited to 'ext/pdo_sqlite/tests')
-rw-r--r--ext/pdo_sqlite/tests/bug79664.phpt32
1 files changed, 32 insertions, 0 deletions
diff --git a/ext/pdo_sqlite/tests/bug79664.phpt b/ext/pdo_sqlite/tests/bug79664.phpt
new file mode 100644
index 0000000000..072d107ba6
--- /dev/null
+++ b/ext/pdo_sqlite/tests/bug79664.phpt
@@ -0,0 +1,32 @@
+--TEST--
+Bug #79664 (PDOStatement::getColumnMeta fails on empty result set)
+--SKIPIF--
+<?php
+if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
+?>
+--FILE--
+<?php
+$pdo = new PDO('sqlite::memory:', null, null, [
+ PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
+]);
+$stmt = $pdo->query('select 1 where 0');
+if ($stmt->columnCount()) {
+ var_dump($stmt->getColumnMeta(0));
+}
+?>
+--EXPECT--
+array(6) {
+ ["native_type"]=>
+ string(4) "null"
+ ["flags"]=>
+ array(0) {
+ }
+ ["name"]=>
+ string(1) "1"
+ ["len"]=>
+ int(4294967295)
+ ["precision"]=>
+ int(0)
+ ["pdo_type"]=>
+ int(2)
+}