Lines Matching refs:colno
472 static int pgsql_stmt_describe(pdo_stmt_t *stmt, int colno) in pgsql_stmt_describe() argument
483 str = PQfname(S->result, colno); in pgsql_stmt_describe()
484 cols[colno].name = zend_string_init(str, strlen(str), 0); in pgsql_stmt_describe()
485 cols[colno].maxlen = PQfsize(S->result, colno); in pgsql_stmt_describe()
486 cols[colno].precision = PQfmod(S->result, colno); in pgsql_stmt_describe()
487 S->cols[colno].pgsql_type = PQftype(S->result, colno); in pgsql_stmt_describe()
489 switch (S->cols[colno].pgsql_type) { in pgsql_stmt_describe()
492 cols[colno].param_type = PDO_PARAM_BOOL; in pgsql_stmt_describe()
498 (param = zend_hash_index_find_ptr(stmt->bound_columns, colno)) != NULL || in pgsql_stmt_describe()
499 (param = zend_hash_find_ptr(stmt->bound_columns, cols[colno].name)) != NULL)) { in pgsql_stmt_describe()
502 cols[colno].param_type = PDO_PARAM_LOB; in pgsql_stmt_describe()
506 cols[colno].param_type = PDO_PARAM_INT; in pgsql_stmt_describe()
511 cols[colno].param_type = PDO_PARAM_INT; in pgsql_stmt_describe()
516 cols[colno].param_type = PDO_PARAM_INT; in pgsql_stmt_describe()
518 cols[colno].param_type = PDO_PARAM_STR; in pgsql_stmt_describe()
523 cols[colno].param_type = PDO_PARAM_LOB; in pgsql_stmt_describe()
527 cols[colno].param_type = PDO_PARAM_STR; in pgsql_stmt_describe()
533 static int pgsql_stmt_get_col(pdo_stmt_t *stmt, int colno, char **ptr, size_t *len, int *caller_fre… in pgsql_stmt_get_col() argument
544 if (PQgetisnull(S->result, S->current_row - 1, colno)) { /* Check if we got NULL */ in pgsql_stmt_get_col()
548 *ptr = PQgetvalue(S->result, S->current_row - 1, colno); in pgsql_stmt_get_col()
549 *len = PQgetlength(S->result, S->current_row - 1, colno); in pgsql_stmt_get_col()
551 switch (cols[colno].param_type) { in pgsql_stmt_get_col()
554 ZEND_ATOL(S->cols[colno].intval, *ptr); in pgsql_stmt_get_col()
555 *ptr = (char *) &(S->cols[colno].intval); in pgsql_stmt_get_col()
560 S->cols[colno].boolval = **ptr == 't'; in pgsql_stmt_get_col()
561 *ptr = (char *) &(S->cols[colno].boolval); in pgsql_stmt_get_col()
566 if (S->cols[colno].pgsql_type == OIDOID) { in pgsql_stmt_get_col()
640 static int pgsql_stmt_get_column_meta(pdo_stmt_t *stmt, zend_long colno, zval *return_value) in pgsql_stmt_get_column_meta() argument
653 if (colno >= stmt->column_count) { in pgsql_stmt_get_column_meta()
658 add_assoc_long(return_value, "pgsql:oid", S->cols[colno].pgsql_type); in pgsql_stmt_get_column_meta()
660 table_oid = PQftable(S->result, colno); in pgsql_stmt_get_column_meta()
668 switch (S->cols[colno].pgsql_type) { in pgsql_stmt_get_column_meta()
698 spprintf(&q, 0, "SELECT TYPNAME FROM PG_TYPE WHERE OID=%u", S->cols[colno].pgsql_type); in pgsql_stmt_get_column_meta()