[Phplib-trackers] [ phplib-Bugs-561019 ] db_pgsql.inc: lock() causes a warning
Brought to you by:
nhruby,
richardarcher
|
From: <no...@so...> - 2002-05-27 10:38:32
|
Bugs item #561019, was opened at 2002-05-27 10:38 You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=561019&group_id=31885 Category: DB_SQL Group: current CVS Status: Open Resolution: None Priority: 5 Submitted By: Marco Pratesi (pratesi) Assigned to: Nobody/Anonymous (nobody) Summary: db_pgsql.inc: lock() causes a warning Initial Comment: With the PostgreSQL class, the following code causes a warning: $qid = new DB_Sql(); $qid->lock("tablename"); The warning is: Warning: Supplied argument is not a valid PostgreSQL link resource... This is due to the fact that in this case the constructor issues an empty query, that causes a "return 0" without issuing "$this-connect()". When lock() is requested, the following line is executed: $result = pg_Exec($this->Link_ID, "lock table $table"); but $this->Link_ID is not a valid link, as connect() has not been executed yet. The problem could be solved using $this->query() instead of pg_Exec(), in analogy to what is done in db_mysql.inc, as in the following: $result = $this->query("lock table $table"); ---------------------------------------------------------------------- You can respond by visiting: http://sourceforge.net/tracker/?func=detail&atid=403611&aid=561019&group_id=31885 |