[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Phpgroupware-developers] Patches for PostgreSQL??
From: |
Dani Oderbolz |
Subject: |
Re: [Phpgroupware-developers] Patches for PostgreSQL?? |
Date: |
Tue, 25 Nov 2003 12:13:17 +0100 |
User-agent: |
Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.4) Gecko/20030624 |
Brian Johnson wrote:
The 'cause' is postgresl 7.3
They decided to change how they handle empty fields in this version
Its true that this Postgres change (ACK that they changed it) causes many
problems.
But it cuases problems with queries which are, say, less than optimal.
Many people confuse '' by NULL for example, but this just is not the same!
Consider this code for example:
./phpgwapi/setup/tables_update_0_9_10.inc.php: $db2->query("SELECT
account_lid FROM phpgw_accounts WHERE account_lid='$group_name'",__LINE__,__FILE__);
So, if account_lid is not set you get this:
SELECT account_lid FROM phpgw_accounts WHERE account_lid=''
The resultset will contain all rows, whose account
is an empty string - which is allowed!
So logically, this is really bad.
The *Intention* however was this:
SELECT account_lid FROM phpgw_accounts WHERE account_lid IS NULL
Which cannot occour, because account_lid has a NOT NULL Constraint.
See the problem?
Cheers,
Dani
- [Phpgroupware-developers] Patches for PostgreSQL??, Dani Oderbolz, 2003/11/21
- RE: [Phpgroupware-developers] Patches for PostgreSQL??, Kai Hofmann, 2003/11/21
- Re: [Phpgroupware-developers] Patches for PostgreSQL??, Chris Weiss, 2003/11/21
- Re: [Phpgroupware-developers] Patches for PostgreSQL??, Chris Weiss, 2003/11/21
- Re: [Phpgroupware-developers] Patches for PostgreSQL??, Brian Johnson, 2003/11/21
- Re: [Phpgroupware-developers] Patches for PostgreSQL??,
Dani Oderbolz <=
- Re: [Phpgroupware-developers] Patches for PostgreSQL??, Chris Weiss, 2003/11/21
- Re: [Phpgroupware-developers] Patches for PostgreSQL??, Brian Johnson, 2003/11/25
- Re: [Phpgroupware-developers] Patches for PostgreSQL??, Dave Hall, 2003/11/25
- RE: [Phpgroupware-developers] Patches for PostgreSQL??, Dirk Schaller, 2003/11/26
- RE: [Phpgroupware-developers] Patches for PostgreSQL??, Dirk Schaller, 2003/11/26