diff options
Diffstat (limited to 'ext/oci8/oci8_statement.c')
-rw-r--r-- | ext/oci8/oci8_statement.c | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/ext/oci8/oci8_statement.c b/ext/oci8/oci8_statement.c index 56882cf908..520809c81d 100644 --- a/ext/oci8/oci8_statement.c +++ b/ext/oci8/oci8_statement.c @@ -928,19 +928,16 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC) } break; + case SQLT_CHR: + case SQLT_AFC: case SQLT_INT: case SQLT_NUM: - if (Z_TYPE_P(bind->zval) == IS_RESOURCE || Z_TYPE_P(bind->zval) == IS_OBJECT) { - php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind"); - *(int *)result = 1; - } - break; - +#if defined(OCI_MAJOR_VERSION) && OCI_MAJOR_VERSION >= 12 + case SQLT_BOL: +#endif case SQLT_LBI: case SQLT_BIN: case SQLT_LNG: - case SQLT_AFC: - case SQLT_CHR: if (Z_TYPE_P(bind->zval) == IS_RESOURCE || Z_TYPE_P(bind->zval) == IS_OBJECT) { php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind"); *(int *)result = 1; @@ -955,7 +952,7 @@ int php_oci_bind_pre_exec(void *data, void *result TSRMLS_DC) break; } - /* reset all bind stuff to a normal state..-. */ + /* reset all bind stuff to a normal state... */ bind->indicator = 0; return 0; @@ -1185,6 +1182,20 @@ int php_oci_bind_by_name(php_oci_statement *statement, char *name, int name_len, } break; +#if defined(OCI_MAJOR_VERSION) && OCI_MAJOR_VERSION >= 12 + case SQLT_BOL: + if (Z_TYPE_P(var) == IS_RESOURCE || Z_TYPE_P(var) == IS_OBJECT) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid variable used for bind"); + return 1; + } + convert_to_boolean(var); + bind_data = (int *)&Z_LVAL_P(var); + value_sz = sizeof(int); + + mode = OCI_DEFAULT; + break; +#endif + default: php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown or unsupported datatype given: %d", (int)type); return 1; |