]> granicus.if.org Git - php/commitdiff
Add regression tests for pg_transaction_status and pg_result_error_field
authorChristopher Kings-Lynne <chriskl@php.net>
Sat, 19 Mar 2005 09:20:52 +0000 (09:20 +0000)
committerChristopher Kings-Lynne <chriskl@php.net>
Sat, 19 Mar 2005 09:20:52 +0000 (09:20 +0000)
ext/pgsql/tests/02connection.phpt
ext/pgsql/tests/03sync_query.phpt

index 4f21fcdf91c986947677f03f7bfb34193a7930f5..761ddc22a3ad836ecf35b4096c6e254c81df7512 100644 (file)
@@ -23,6 +23,10 @@ if (pg_connection_busy($db))
 {
        echo "pg_connection_busy() error\n";
 }
+if (pg_transaction_status($db) != PGSQL_TRANSACTION_IDLE) 
+{
+       echo "pg_transaction_status() error\n";
+}
 if (!pg_host($db)) 
 {
        echo "pg_host() error\n";
index 96827fe5a21c461cc7d6091596e2bf7bdd74dc61..a2ea7de4e9c44f9f474baa227c6136cd2bd5b234 100644 (file)
@@ -32,6 +32,18 @@ for ($i=0; $i < $rows; $i++)
 }
 
 pg_result_error($result);
+pg_result_error_field($result, PGSQL_DIAG_SEVERITY);
+pg_result_error_field($result, PGSQL_DIAG_SQLSTATE);
+pg_result_error_field($result, PGSQL_DIAG_MESSAGE_PRIMARY);
+pg_result_error_field($result, PGSQL_DIAG_MESSAGE_DETAIL);
+pg_result_error_field($result, PGSQL_DIAG_MESSAGE_HINT);
+pg_result_error_field($result, PGSQL_DIAG_STATEMENT_POSITION);
+pg_result_error_field($result, PGSQL_DIAG_INTERNAL_POSITION);
+pg_result_error_field($result, PGSQL_DIAG_INTERNAL_QUERY);
+pg_result_error_field($result, PGSQL_DIAG_CONTEXT);
+pg_result_error_field($result, PGSQL_DIAG_SOURCE_FILE);
+pg_result_error_field($result, PGSQL_DIAG_SOURCE_LINE);
+pg_result_error_field($result, PGSQL_DIAG_SOURCE_FUNCTION);
 pg_num_rows(pg_query($db, "SELECT * FROM ".$table_name.";"));
 pg_num_fields(pg_query($db, "SELECT * FROM ".$table_name.";"));
 pg_field_name($result, 0);