[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:56:39
|
Bugs item #561019, was opened at 2002-05-27 06: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: nathan hruby (nhruby) Date: 2002-07-03 17:56 Message: Logged In: YES user_id=19736 > Maybe we should just bite the bullet and commit this stuff > to -stable and then fix any problems which arise. Yes please :) That's what the -pre's are for.. to suss out the bugs by the advertursome and intelligent users before releasing to the masses. ---------------------------------------------------------------------- Comment By: Richard Archer (richardarcher) Date: 2002-07-03 17:46 Message: Logged In: YES user_id=279311 I did a lot of work on some of the db classes (MySQL, OCI8, ODBC come to mind). But I don't have most of those other databases running to test with. I think you'll find most of my work is in the devel tree only. I wasn't willing to commit untested code to the -stable tree. For example, the odbc driver in devel has *heaps* of improvements and bug fixes. It even implements lock(). While I did have an ODBC datasource at the time, I wasn't willing to commit a 500 line patch to -stable based on my development testing alone. Maybe we should just bite the bullet and commit this stuff to -stable and then fix any problems which arise. ---------------------------------------------------------------------- Comment By: Chris Johnson (chaska) Date: 2002-07-03 17: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 |