Lines Matching refs:var

146 		XSQLVAR const *var = &sqlda->sqlvar[i];  in php_firebird_free_sqlda()  local
148 if (var->sqlind) { in php_firebird_free_sqlda()
149 efree(var->sqlind); in php_firebird_free_sqlda()
203 XSQLVAR *var = &S->out_sqlda.sqlvar[i]; in pdo_firebird_stmt_execute() local
204 if (var->sqlind) { in pdo_firebird_stmt_execute()
205 efree(var->sqlind); in pdo_firebird_stmt_execute()
207 var->sqlind = (void*)ecalloc(1, var->sqllen + 2 * sizeof(short)); in pdo_firebird_stmt_execute()
208 var->sqldata = &((char*)var->sqlind)[sizeof(short)]; in pdo_firebird_stmt_execute()
309 XSQLVAR *var = &S->out_sqlda.sqlvar[colno]; in pdo_firebird_stmt_describe() local
313 if ((var->sqltype & ~1) == SQL_TEXT) { in pdo_firebird_stmt_describe()
314 var->sqltype = SQL_VARYING | (var->sqltype & 1); in pdo_firebird_stmt_describe()
316 colname_len = (S->H->fetch_table_names && var->relname_length) in pdo_firebird_stmt_describe()
317 ? (var->aliasname_length + var->relname_length + 1) in pdo_firebird_stmt_describe()
318 : (var->aliasname_length); in pdo_firebird_stmt_describe()
319 col->precision = -var->sqlscale; in pdo_firebird_stmt_describe()
320 col->maxlen = var->sqllen; in pdo_firebird_stmt_describe()
323 if (colname_len > var->aliasname_length) { in pdo_firebird_stmt_describe()
324 memmove(cp, var->relname, var->relname_length); in pdo_firebird_stmt_describe()
325 cp += var->relname_length; in pdo_firebird_stmt_describe()
328 memmove(cp, var->aliasname, var->aliasname_length); in pdo_firebird_stmt_describe()
329 *(cp+var->aliasname_length) = '\0'; in pdo_firebird_stmt_describe()
338 XSQLVAR *var = &S->out_sqlda.sqlvar[colno]; in pdo_firebird_stmt_get_column_meta() local
341 if (var->sqlscale < 0) { in pdo_firebird_stmt_get_column_meta()
344 switch (var->sqltype & ~1) { in pdo_firebird_stmt_get_column_meta()
458 XSQLVAR const *var = &S->out_sqlda.sqlvar[colno]; in pdo_firebird_stmt_get_col() local
460 if (*var->sqlind == -1) { in pdo_firebird_stmt_get_col()
463 if (var->sqlscale < 0) { in pdo_firebird_stmt_get_col()
481 ISC_INT64 n, f = scales[-var->sqlscale]; in pdo_firebird_stmt_get_col()
484 switch (var->sqltype & ~1) { in pdo_firebird_stmt_get_col()
486 n = *(short*)var->sqldata; in pdo_firebird_stmt_get_col()
489 n = php_get_isc_long_from_sqldata(var->sqldata); in pdo_firebird_stmt_get_col()
492 n = php_get_isc_int64_from_sqldata(var->sqldata); in pdo_firebird_stmt_get_col()
499 if ((var->sqltype & ~1) == SQL_DOUBLE) { in pdo_firebird_stmt_get_col()
500 str = zend_strpprintf(0, "%.*F", -var->sqlscale, php_get_double_from_sqldata(var->sqldata)); in pdo_firebird_stmt_get_col()
503 n / f, -var->sqlscale, n % f); in pdo_firebird_stmt_get_col()
506 n / f, -var->sqlscale, -n % f); in pdo_firebird_stmt_get_col()
508 str = zend_strpprintf(0, "-0.%0*" LL_MASK "d", -var->sqlscale, -n % f); in pdo_firebird_stmt_get_col()
512 switch (var->sqltype & ~1) { in pdo_firebird_stmt_get_col()
517 ZVAL_STRINGL_FAST(result, &var->sqldata[2], *(short*)var->sqldata); in pdo_firebird_stmt_get_col()
520 ZVAL_STRINGL_FAST(result, var->sqldata, var->sqllen); in pdo_firebird_stmt_get_col()
523 ZVAL_LONG(result, *(short*)var->sqldata); in pdo_firebird_stmt_get_col()
526 ZVAL_LONG(result, php_get_isc_long_from_sqldata(var->sqldata)); in pdo_firebird_stmt_get_col()
530 ZVAL_LONG(result, php_get_isc_int64_from_sqldata(var->sqldata)); in pdo_firebird_stmt_get_col()
532 …ZVAL_STR(result, zend_strpprintf(0, "%" LL_MASK "d", php_get_isc_int64_from_sqldata(var->sqldata))… in pdo_firebird_stmt_get_col()
537 … ZVAL_STR(result, zend_strpprintf_unchecked(0, "%.8H", php_get_float_from_sqldata(var->sqldata))); in pdo_firebird_stmt_get_col()
541 …ZVAL_STR(result, zend_strpprintf_unchecked(0, "%.16H", php_get_double_from_sqldata(var->sqldata))); in pdo_firebird_stmt_get_col()
544 ZVAL_BOOL(result, *(FB_BOOLEAN*)var->sqldata); in pdo_firebird_stmt_get_col()
547 isc_decode_sql_date((ISC_DATE*)var->sqldata, &t); in pdo_firebird_stmt_get_col()
551 isc_decode_sql_time((ISC_TIME*)var->sqldata, &t); in pdo_firebird_stmt_get_col()
556 ISC_TIMESTAMP timestamp = php_get_isc_timestamp_from_sqldata(var->sqldata); in pdo_firebird_stmt_get_col()
568 ISC_TIME_TZ time = php_get_isc_time_tz_from_sqldata(var->sqldata); in pdo_firebird_stmt_get_col()
572 ISC_TIMESTAMP_TZ ts = php_get_isc_timestamp_tz_from_sqldata(var->sqldata); in pdo_firebird_stmt_get_col()
577 ISC_QUAD quad = php_get_isc_quad_from_sqldata(var->sqldata); in pdo_firebird_stmt_get_col()
633 XSQLVAR *var; in pdo_firebird_stmt_param_hook() local
655 XSQLVAR *var = &sqlda->sqlvar[i]; in pdo_firebird_stmt_param_hook() local
657 if ((var->aliasname_length && !strncasecmp(ZSTR_VAL(param->name), var->aliasname, in pdo_firebird_stmt_param_hook()
658 min(ZSTR_LEN(param->name), var->aliasname_length))) in pdo_firebird_stmt_param_hook()
659 || (var->sqlname_length && !strncasecmp(ZSTR_VAL(param->name), var->sqlname, in pdo_firebird_stmt_param_hook()
660 min(ZSTR_LEN(param->name), var->sqlname_length)))) { in pdo_firebird_stmt_param_hook()
673 var = &sqlda->sqlvar[param->paramno]; in pdo_firebird_stmt_param_hook()
681 if (var->sqlind) { in pdo_firebird_stmt_param_hook()
682 efree(var->sqlind); in pdo_firebird_stmt_param_hook()
684 var->sqlind = (void*)emalloc(var->sqllen + 2*sizeof(short)); in pdo_firebird_stmt_param_hook()
685 var->sqldata = &((char*)var->sqlind)[sizeof(short)]; in pdo_firebird_stmt_param_hook()
694 *var->sqlind = 0; in pdo_firebird_stmt_param_hook()
715 switch (var->sqltype & ~1) { in pdo_firebird_stmt_param_hook()
726 if (~var->sqltype & 1) { in pdo_firebird_stmt_param_hook()
731 *var->sqlind = -1; in pdo_firebird_stmt_param_hook()
734 ISC_QUAD quad = php_get_isc_quad_from_sqldata(var->sqldata); in pdo_firebird_stmt_param_hook()
736 memcpy(var->sqldata, &quad, sizeof(quad)); in pdo_firebird_stmt_param_hook()
744 if ((var->sqltype & ~1) == SQL_BOOLEAN) { in pdo_firebird_stmt_param_hook()
750 *(FB_BOOLEAN*)var->sqldata = zend_is_true(parameter) ? FB_TRUE : FB_FALSE; in pdo_firebird_stmt_param_hook()
758 *(FB_BOOLEAN*)var->sqldata = FB_FALSE; in pdo_firebird_stmt_param_hook()
764 *(FB_BOOLEAN*)var->sqldata = (lval != 0) ? FB_TRUE : FB_FALSE; in pdo_firebird_stmt_param_hook()
767 *(FB_BOOLEAN*)var->sqldata = (dval != 0) ? FB_TRUE : FB_FALSE; in pdo_firebird_stmt_param_hook()
771 *(FB_BOOLEAN*)var->sqldata = FB_TRUE; in pdo_firebird_stmt_param_hook()
773 *(FB_BOOLEAN*)var->sqldata = FB_FALSE; in pdo_firebird_stmt_param_hook()
784 *var->sqlind = -1; in pdo_firebird_stmt_param_hook()
802 var->sqltype = (sizeof(zend_long) == 8 ? SQL_INT64 : SQL_LONG) | (var->sqltype & 1); in pdo_firebird_stmt_param_hook()
803 var->sqldata = (void*)&Z_LVAL_P(parameter); in pdo_firebird_stmt_param_hook()
804 var->sqllen = sizeof(zend_long); in pdo_firebird_stmt_param_hook()
808 var->sqltype = SQL_DOUBLE | (var->sqltype & 1); in pdo_firebird_stmt_param_hook()
809 var->sqldata = (void*)&Z_DVAL_P(parameter); in pdo_firebird_stmt_param_hook()
810 var->sqllen = sizeof(double); in pdo_firebird_stmt_param_hook()
816 switch (var->sqltype & ~1) { in pdo_firebird_stmt_param_hook()
836 var->sqltype = SQL_TEXT | (var->sqltype & 1); in pdo_firebird_stmt_param_hook()
837 var->sqldata = Z_STRVAL_P(parameter); in pdo_firebird_stmt_param_hook()
838 var->sqllen = Z_STRLEN_P(parameter); in pdo_firebird_stmt_param_hook()
844 if (~var->sqltype & 1) { in pdo_firebird_stmt_param_hook()
849 *var->sqlind = -1; in pdo_firebird_stmt_param_hook()