Lines Matching refs:bind
811 php_oci_bind *bind = (php_oci_bind *) data; in php_oci_bind_pre_exec() local
815 if (Z_TYPE_P(bind->zval) == IS_ARRAY) { in php_oci_bind_pre_exec()
822 switch (bind->type) { in php_oci_bind_pre_exec()
829 if (Z_TYPE_P(bind->zval) != IS_OBJECT) { in php_oci_bind_pre_exec()
837 if (Z_TYPE_P(bind->zval) == IS_RESOURCE || Z_TYPE_P(bind->zval) == IS_OBJECT) { in php_oci_bind_pre_exec()
848 if (Z_TYPE_P(bind->zval) == IS_RESOURCE || Z_TYPE_P(bind->zval) == IS_OBJECT) { in php_oci_bind_pre_exec()
855 if (Z_TYPE_P(bind->zval) != IS_RESOURCE) { in php_oci_bind_pre_exec()
863 bind->indicator = 0; in php_oci_bind_pre_exec()
873 php_oci_bind *bind = (php_oci_bind *) data; in php_oci_bind_post_exec() local
874 php_oci_connection *connection = bind->parent_statement->connection; in php_oci_bind_post_exec()
876 if (bind->indicator == -1) { /* NULL */ in php_oci_bind_post_exec()
877 zval *val = bind->zval; in php_oci_bind_post_exec()
883 } else if (Z_TYPE_P(bind->zval) == IS_STRING in php_oci_bind_post_exec()
884 && Z_STRLEN_P(bind->zval) > 0 in php_oci_bind_post_exec()
885 && Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] != '\0') { in php_oci_bind_post_exec()
892 Z_STRVAL_P(bind->zval) = erealloc(Z_STRVAL_P(bind->zval), Z_STRLEN_P(bind->zval)+1); in php_oci_bind_post_exec()
893 Z_STRVAL_P(bind->zval)[ Z_STRLEN_P(bind->zval) ] = '\0'; in php_oci_bind_post_exec() local
894 } else if (Z_TYPE_P(bind->zval) == IS_ARRAY) { in php_oci_bind_post_exec()
897 HashTable *hash = HASH_OF(bind->zval); in php_oci_bind_post_exec()
901 switch (bind->array.type) { in php_oci_bind_post_exec()
905 for (i = 0; i < bind->array.current_length; i++) { in php_oci_bind_post_exec()
906 …if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE… in php_oci_bind_post_exec()
908 ZVAL_LONG(*entry, ((ub4 *)(bind->array.elements))[i]); in php_oci_bind_post_exec()
911 add_next_index_long(bind->zval, ((ub4 *)(bind->array.elements))[i]); in php_oci_bind_post_exec()
916 for (i = 0; i < bind->array.current_length; i++) { in php_oci_bind_post_exec()
917 …if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE… in php_oci_bind_post_exec()
919 ZVAL_DOUBLE(*entry, ((double *)(bind->array.elements))[i]); in php_oci_bind_post_exec()
922 add_next_index_double(bind->zval, ((double *)(bind->array.elements))[i]); in php_oci_bind_post_exec()
927 for (i = 0; i < bind->array.current_length; i++) { in php_oci_bind_post_exec()
933 …if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE… in php_oci_bind_post_exec()
934 …PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err, &(((OCIDate *)(bind->arr… in php_oci_bind_post_exec()
946 …PHP_OCI_CALL_RETURN(connection->errcode, OCIDateToText, (connection->err, &(((OCIDate *)(bind->arr… in php_oci_bind_post_exec()
950 add_next_index_null(bind->zval); in php_oci_bind_post_exec()
952 add_next_index_stringl(bind->zval, (char *)buff, buff_len, 1); in php_oci_bind_post_exec()
964 for (i = 0; i < bind->array.current_length; i++) { in php_oci_bind_post_exec()
966 int curr_element_length = bind->array.element_lengths[i]; in php_oci_bind_post_exec()
967 …if ((i < bind->array.old_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAILURE… in php_oci_bind_post_exec()
969 …ZVAL_STRINGL(*entry, (char *)(((text *)bind->array.elements)+i*bind->array.max_length), curr_eleme… in php_oci_bind_post_exec()
972 …add_next_index_stringl(bind->zval, (char *)(((text *)bind->array.elements)+i*bind->array.max_lengt… in php_oci_bind_post_exec()
994 php_oci_bind bind, *old_bind, *bindp; in php_oci_bind_by_name() local
1103 memset((void*)&bind,0,sizeof(php_oci_bind)); in php_oci_bind_by_name()
1110 …zend_hash_update(statement->binds, name, name_len + 1, &bind, sizeof(php_oci_bind), (void **)&bind… in php_oci_bind_by_name()
1124 (OCIBind **)&bindp->bind, /* bind hdl (will alloc) */ in php_oci_bind_by_name()
1149 bindp->bind, in php_oci_bind_by_name()
1169 bindp->bind, in php_oci_bind_by_name()
1409 php_oci_bind *bind, *bindp; in php_oci_bind_array_by_name() local
1422 bind = php_oci_bind_array_helper_number(var, max_table_length TSRMLS_CC); in php_oci_bind_array_by_name()
1426 bind = php_oci_bind_array_helper_double(var, max_table_length TSRMLS_CC); in php_oci_bind_array_by_name()
1439 bind = php_oci_bind_array_helper_string(var, max_table_length, maxlength TSRMLS_CC); in php_oci_bind_array_by_name()
1442 bind = php_oci_bind_array_helper_date(var, max_table_length, statement->connection TSRMLS_CC); in php_oci_bind_array_by_name()
1450 if (bind == NULL) { in php_oci_bind_array_by_name()
1460 …zend_hash_update(statement->binds, name, name_len + 1, bind, sizeof(php_oci_bind), (void **)&bindp… in php_oci_bind_array_by_name()
1465 bindp->bind = NULL; in php_oci_bind_array_by_name()
1477 (OCIBind **)&bindp->bind, in php_oci_bind_array_by_name()
1482 (sb4) bind->array.max_length, in php_oci_bind_array_by_name()
1485 (ub2 *)bind->array.element_lengths, in php_oci_bind_array_by_name()
1495 efree(bind); in php_oci_bind_array_by_name()
1500 efree(bind); in php_oci_bind_array_by_name()
1508 php_oci_bind *bind; in php_oci_bind_array_helper_string() local
1526 bind = emalloc(sizeof(php_oci_bind)); in php_oci_bind_array_helper_string()
1527 bind->array.elements = (text *)safe_emalloc(max_table_length * (maxlength + 1), sizeof(text), 0); in php_oci_bind_array_helper_string()
1528 memset(bind->array.elements, 0, max_table_length * (maxlength + 1) * sizeof(text)); in php_oci_bind_array_helper_string()
1529 bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var)); in php_oci_bind_array_helper_string()
1530 bind->array.old_length = bind->array.current_length; in php_oci_bind_array_helper_string()
1531 bind->array.max_length = maxlength; in php_oci_bind_array_helper_string()
1532 bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0); in php_oci_bind_array_helper_string()
1533 memset(bind->array.element_lengths, 0, max_table_length*sizeof(ub2)); in php_oci_bind_array_helper_string()
1534 bind->array.indicators = safe_emalloc(max_table_length, sizeof(sb2), 0); in php_oci_bind_array_helper_string()
1535 memset(bind->array.indicators, 0, max_table_length*sizeof(sb2)); in php_oci_bind_array_helper_string()
1539 for (i = 0; i < bind->array.current_length; i++) { in php_oci_bind_array_helper_string()
1542 bind->array.element_lengths[i] = Z_STRLEN_PP(entry); in php_oci_bind_array_helper_string()
1544 bind->array.indicators[i] = -1; in php_oci_bind_array_helper_string()
1554 …if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAI… in php_oci_bind_array_helper_string()
1560 memcpy((text *)bind->array.elements + i*maxlength, Z_STRVAL_PP(entry), element_length); in php_oci_bind_array_helper_string()
1561 ((text *)bind->array.elements)[i*maxlength + element_length] = '\0'; in php_oci_bind_array_helper_string()
1565 ((text *)bind->array.elements)[i*maxlength] = '\0'; in php_oci_bind_array_helper_string()
1570 return bind; in php_oci_bind_array_helper_string()
1577 php_oci_bind *bind; in php_oci_bind_array_helper_number() local
1584 bind = emalloc(sizeof(php_oci_bind)); in php_oci_bind_array_helper_number()
1585 bind->array.elements = (ub4 *)safe_emalloc(max_table_length, sizeof(ub4), 0); in php_oci_bind_array_helper_number()
1586 bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var)); in php_oci_bind_array_helper_number()
1587 bind->array.old_length = bind->array.current_length; in php_oci_bind_array_helper_number()
1588 bind->array.max_length = sizeof(ub4); in php_oci_bind_array_helper_number()
1589 bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0); in php_oci_bind_array_helper_number()
1590 memset(bind->array.element_lengths, 0, max_table_length * sizeof(ub2)); in php_oci_bind_array_helper_number()
1591 bind->array.indicators = NULL; in php_oci_bind_array_helper_number()
1595 if (i < bind->array.current_length) { in php_oci_bind_array_helper_number()
1596 bind->array.element_lengths[i] = sizeof(ub4); in php_oci_bind_array_helper_number()
1598 …if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAI… in php_oci_bind_array_helper_number()
1600 ((ub4 *)bind->array.elements)[i] = (ub4) Z_LVAL_PP(entry); in php_oci_bind_array_helper_number()
1603 ((ub4 *)bind->array.elements)[i] = 0; in php_oci_bind_array_helper_number()
1608 return bind; in php_oci_bind_array_helper_number()
1615 php_oci_bind *bind; in php_oci_bind_array_helper_double() local
1622 bind = emalloc(sizeof(php_oci_bind)); in php_oci_bind_array_helper_double()
1623 bind->array.elements = (double *)safe_emalloc(max_table_length, sizeof(double), 0); in php_oci_bind_array_helper_double()
1624 bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var)); in php_oci_bind_array_helper_double()
1625 bind->array.old_length = bind->array.current_length; in php_oci_bind_array_helper_double()
1626 bind->array.max_length = sizeof(double); in php_oci_bind_array_helper_double()
1627 bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0); in php_oci_bind_array_helper_double()
1628 memset(bind->array.element_lengths, 0, max_table_length * sizeof(ub2)); in php_oci_bind_array_helper_double()
1629 bind->array.indicators = NULL; in php_oci_bind_array_helper_double()
1633 if (i < bind->array.current_length) { in php_oci_bind_array_helper_double()
1634 bind->array.element_lengths[i] = sizeof(double); in php_oci_bind_array_helper_double()
1636 …if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAI… in php_oci_bind_array_helper_double()
1638 ((double *)bind->array.elements)[i] = (double) Z_DVAL_PP(entry); in php_oci_bind_array_helper_double()
1641 ((double *)bind->array.elements)[i] = 0; in php_oci_bind_array_helper_double()
1646 return bind; in php_oci_bind_array_helper_double()
1653 php_oci_bind *bind; in php_oci_bind_array_helper_date() local
1660 bind = emalloc(sizeof(php_oci_bind)); in php_oci_bind_array_helper_date()
1661 bind->array.elements = (OCIDate *)safe_emalloc(max_table_length, sizeof(OCIDate), 0); in php_oci_bind_array_helper_date()
1662 bind->array.current_length = zend_hash_num_elements(Z_ARRVAL_P(var)); in php_oci_bind_array_helper_date()
1663 bind->array.old_length = bind->array.current_length; in php_oci_bind_array_helper_date()
1664 bind->array.max_length = sizeof(OCIDate); in php_oci_bind_array_helper_date()
1665 bind->array.element_lengths = safe_emalloc(max_table_length, sizeof(ub2), 0); in php_oci_bind_array_helper_date()
1666 memset(bind->array.element_lengths, 0, max_table_length * sizeof(ub2)); in php_oci_bind_array_helper_date()
1667 bind->array.indicators = NULL; in php_oci_bind_array_helper_date()
1672 if (i < bind->array.current_length) { in php_oci_bind_array_helper_date()
1673 bind->array.element_lengths[i] = sizeof(OCIDate); in php_oci_bind_array_helper_date()
1675 …if ((i < bind->array.current_length) && (zend_hash_get_current_data(hash, (void **) &entry) != FAI… in php_oci_bind_array_helper_date()
1682 efree(bind->array.element_lengths); in php_oci_bind_array_helper_date()
1683 efree(bind->array.elements); in php_oci_bind_array_helper_date()
1684 efree(bind); in php_oci_bind_array_helper_date()
1690 ((OCIDate *)bind->array.elements)[i] = oci_date; in php_oci_bind_array_helper_date()
1697 efree(bind->array.element_lengths); in php_oci_bind_array_helper_date()
1698 efree(bind->array.elements); in php_oci_bind_array_helper_date()
1699 efree(bind); in php_oci_bind_array_helper_date()
1705 ((OCIDate *)bind->array.elements)[i] = oci_date; in php_oci_bind_array_helper_date()
1710 return bind; in php_oci_bind_array_helper_date()