summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimm Friebe <thekid@php.net>2008-11-09 10:44:03 +0000
committerTimm Friebe <thekid@php.net>2008-11-09 10:44:03 +0000
commit7dc8109ff3247aae20629a0224d3d17d5d5d0566 (patch)
tree8158232628308f52868a3e4c3ba5eb34ada2ca8a
parent34906d50f306c4a037bda532a5eecc00f5192733 (diff)
downloadphp-git-7dc8109ff3247aae20629a0224d3d17d5d5d0566.tar.gz
- Initial release
-rw-r--r--ext/sybase_ct/tests/bug43578.phpt65
1 files changed, 65 insertions, 0 deletions
diff --git a/ext/sybase_ct/tests/bug43578.phpt b/ext/sybase_ct/tests/bug43578.phpt
new file mode 100644
index 0000000000..e840402edc
--- /dev/null
+++ b/ext/sybase_ct/tests/bug43578.phpt
@@ -0,0 +1,65 @@
+--TEST--
+Sybase-CT bug #43578 (Incurred fault #6 - if returned textfield ist empty)
+--SKIPIF--
+<?php require('skipif.inc'); ?>
+--FILE--
+<?php
+/* This file is part of PHP test framework for ext/sybase_ct
+ *
+ * $Id$
+ */
+
+ require('test.inc');
+
+ $db= sybase_connect_ex();
+
+ // Create a temporary table and fill it with test values
+ var_dump(sybase_query('
+ create table #Resource (
+ Resource_ID int,
+ DC_Rights text null
+ )
+ ', $db));
+ var_dump(sybase_query('insert into #Resource values (123, NULL)', $db));
+ var_dump(sybase_query('insert into #Resource values (124, "")', $db));
+
+ // Select non-existant
+ var_dump(sybase_select_ex($db, 'select DC_Rights from #Resource where Resource_ID = 122'));
+
+ // Select null
+ var_dump(sybase_select_ex($db, 'select DC_Rights from #Resource where Resource_ID = 123'));
+
+ // Select empty
+ var_dump(sybase_select_ex($db, 'select DC_Rights from #Resource where Resource_ID = 124'));
+
+ // Clean up and close connection
+ var_dump(sybase_query('drop table #Resource', $db));
+ sybase_close($db);
+?>
+--EXPECTF--
+bool(true)
+bool(true)
+bool(true)
+>>> Query: select DC_Rights from #Resource where Resource_ID = 122
+<<< Return: resource
+array(0) {
+}
+>>> Query: select DC_Rights from #Resource where Resource_ID = 123
+<<< Return: resource
+array(1) {
+ [0]=>
+ array(1) {
+ ["DC_Rights"]=>
+ NULL
+ }
+}
+>>> Query: select DC_Rights from #Resource where Resource_ID = 124
+<<< Return: resource
+array(1) {
+ [0]=>
+ array(1) {
+ ["DC_Rights"]=>
+ string(1) " "
+ }
+}
+bool(true)