]> granicus.if.org Git - php/commitdiff
Chages for new pg_last_notice()
authorYasuo Ohgaki <yohgaki@php.net>
Sat, 6 Apr 2002 06:42:02 +0000 (06:42 +0000)
committerYasuo Ohgaki <yohgaki@php.net>
Sat, 6 Apr 2002 06:42:02 +0000 (06:42 +0000)
ext/pgsql/php_pgsql.h
ext/pgsql/tests/notice.inc

index 85573d8ad8f011591ae2bc107766714f72ce8b83..42313390ca67d72cd9f333b586b1cf1b0b2ea37f 100644 (file)
@@ -141,6 +141,11 @@ typedef struct _php_pgsql_result_handle {
        int row;
 } pgsql_result_handle;
 
+typedef struct _php_pgsql_notice {
+       char *message;
+       size_t len;
+} php_pgsql_notice;
+
 typedef struct {
        long default_link;
        long num_links,num_persistent;
@@ -148,9 +153,8 @@ typedef struct {
        long allow_persistent;
        long auto_reset_persistent;
        int le_lofp,le_string;
-       int ignore_notices;
-       char *last_notice;
-       uint last_notice_len;
+       int ignore_notices,log_notices;
+       HashTable notices;
 } php_pgsql_globals;
 
 
index 7764d458ea8e35a4530e01775952fa8ab507daaa..4c2b1de49e63d38bcd02e4ec7c2228bd815198c1 100644 (file)
@@ -1,11 +1,17 @@
 <?php
 include 'config.inc';
 
+ini_set('pgsql.log_notice',1);
+
 $db = pg_connect($conn_str);
 pg_query($db, "BEGIN;");
 pg_query($db, "BEGIN;");
 
 $msg = pg_last_notice($db);
+if ($msg === FALSE) {
+       echo "Cannot find notice message in hash\n";
+       var_dump($msg);
+}
 echo $msg;
 echo "pg_last_notice() is Ok\n";