version 1.1.1.1, 2012/02/21 23:47:59
|
version 1.1.1.3, 2013/07/22 01:31:59
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2012 The PHP Group | | | Copyright (c) 1997-2013 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| This source file is subject to version 3.01 of the PHP license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 76 int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt,
|
Line 76 int _pdo_pgsql_error(pdo_dbh_t *dbh, pdo_stmt_t *stmt,
|
einfo->errmsg = NULL; |
einfo->errmsg = NULL; |
} |
} |
|
|
if (sqlstate == NULL) { | if (sqlstate == NULL || strlen(sqlstate) >= sizeof(pdo_error_type)) { |
strcpy(*pdo_err, "HY000"); |
strcpy(*pdo_err, "HY000"); |
} |
} |
else { |
else { |
Line 299 static long pgsql_handle_doer(pdo_dbh_t *dbh, const ch
|
Line 299 static long pgsql_handle_doer(pdo_dbh_t *dbh, const ch
|
return -1; |
return -1; |
} |
} |
H->pgoid = PQoidValue(res); |
H->pgoid = PQoidValue(res); |
ret = atol(PQcmdTuples(res)); | ret = (qs == PGRES_COMMAND_OK) ? atol(PQcmdTuples(res)) : 0L; |
PQclear(res); |
PQclear(res); |
|
|
return ret; |
return ret; |
Line 497 static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS
|
Line 497 static int pgsql_handle_rollback(pdo_dbh_t *dbh TSRMLS
|
return pdo_pgsql_transaction_cmd("ROLLBACK", dbh TSRMLS_CC); |
return pdo_pgsql_transaction_cmd("ROLLBACK", dbh TSRMLS_CC); |
} |
} |
|
|
|
static int pgsql_handle_in_transaction(pdo_dbh_t *dbh TSRMLS_DC) |
|
{ |
|
pdo_pgsql_db_handle *H; |
|
|
|
H = (pdo_pgsql_db_handle *)dbh->driver_data; |
|
|
|
return PQtransactionStatus(H->server); |
|
} |
|
|
/* {{{ proto string PDO::pgsqlCopyFromArray(string $table_name , array $rows [, string $delimiter [, string $null_as ] [, string $fields]) |
/* {{{ proto string PDO::pgsqlCopyFromArray(string $table_name , array $rows [, string $delimiter [, string $null_as ] [, string $fields]) |
Returns true if the copy worked fine or false if error */ |
Returns true if the copy worked fine or false if error */ |
static PHP_METHOD(PDO, pgsqlCopyFromArray) |
static PHP_METHOD(PDO, pgsqlCopyFromArray) |
Line 619 static PHP_METHOD(PDO, pgsqlCopyFromFile)
|
Line 628 static PHP_METHOD(PDO, pgsqlCopyFromFile)
|
ExecStatusType status; |
ExecStatusType status; |
php_stream *stream; |
php_stream *stream; |
|
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|sss", | if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|sss", |
&table_name, &table_name_len, &filename, &filename_len, |
&table_name, &table_name_len, &filename, &filename_len, |
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) { |
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) { |
return; |
return; |
Line 713 static PHP_METHOD(PDO, pgsqlCopyToFile)
|
Line 722 static PHP_METHOD(PDO, pgsqlCopyToFile)
|
|
|
php_stream *stream; |
php_stream *stream; |
|
|
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|sss", | if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sp|sss", |
&table_name, &table_name_len, &filename, &filename_len, |
&table_name, &table_name_len, &filename, &filename_len, |
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) { |
&pg_delim, &pg_delim_len, &pg_null_as, &pg_null_as_len, &pg_fields, &pg_fields_len) == FAILURE) { |
return; |
return; |
Line 1022 static struct pdo_dbh_methods pgsql_methods = {
|
Line 1031 static struct pdo_dbh_methods pgsql_methods = {
|
pdo_pgsql_check_liveness, /* check_liveness */ |
pdo_pgsql_check_liveness, /* check_liveness */ |
pdo_pgsql_get_driver_methods, /* get_driver_methods */ |
pdo_pgsql_get_driver_methods, /* get_driver_methods */ |
NULL, |
NULL, |
|
pgsql_handle_in_transaction, |
}; |
}; |
|
|
static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */ |
static int pdo_pgsql_handle_factory(pdo_dbh_t *dbh, zval *driver_options TSRMLS_DC) /* {{{ */ |