[Phplib-trackers] [ phplib-Bugs-561019 ] db_pgsql.inc: lock() causes a warning
Brought to you by:
nhruby,
richardarcher
|
From: <no...@so...> - 2002-07-03 21:05:44
|
Bugs item #561019, was opened at 2002-05-27 05:38 You can respond by visiting: https://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"); ---------------------------------------------------------------------- >Comment By: Chris Johnson (chaska) Date: 2002-07-03 16:05 Message: Logged In: YES user_id=279065 I thought one of our fearless programmers had gone through the db_* classes and made them more uniform? Or was a I dreaming? ..chris ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=403611&aid=561019&group_id=31885 |