summaryrefslogtreecommitdiff
path: root/ext/dba/dba_flatfile.c
diff options
context:
space:
mode:
authorLars Strojny <lstrojny@php.net>2013-01-15 09:30:44 +0100
committerLars Strojny <lstrojny@php.net>2013-01-15 09:30:44 +0100
commiteb40f73ca0a2a7563fbc95cc22741412e0beb76e (patch)
tree20dc73418d5266e84f16f65b2a7c23a463f0113b /ext/dba/dba_flatfile.c
parent6dc80f080ea97c09b36d8a05ec7ec5067f394c01 (diff)
downloadphp-git-eb40f73ca0a2a7563fbc95cc22741412e0beb76e.tar.gz
Bug #62489: dba_insert not working as expected
Diffstat (limited to 'ext/dba/dba_flatfile.c')
-rw-r--r--ext/dba/dba_flatfile.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/ext/dba/dba_flatfile.c b/ext/dba/dba_flatfile.c
index 082aa5cdb6..34aa635a54 100644
--- a/ext/dba/dba_flatfile.c
+++ b/ext/dba/dba_flatfile.c
@@ -88,15 +88,16 @@ DBA_UPDATE_FUNC(flatfile)
gval.dsize = vallen;
switch(flatfile_store(dba, gkey, gval, mode==1 ? FLATFILE_INSERT : FLATFILE_REPLACE TSRMLS_CC)) {
- case -1:
- php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Operation not possible");
- return FAILURE;
- default:
- case 0:
- return SUCCESS;
- case 1:
- php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Key already exists");
- return FAILURE;
+ case 0:
+ return SUCCESS;
+ case 1:
+ return FAILURE;
+ case -1:
+ php_error_docref1(NULL TSRMLS_CC, key, E_WARNING, "Operation not possible");
+ return FAILURE;
+ default:
+ php_error_docref2(NULL TSRMLS_CC, key, val, E_WARNING, "Unknown return value");
+ return FAILURE;
}
}