nss-mysql-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Nss-mysql-devel] [Patch #47] table qualifiers lossage


From: nobody
Subject: [Nss-mysql-devel] [Patch #47] table qualifiers lossage
Date: Thu, 01 Nov 2001 07:39:02 -0500

Patch #47 has been updated. 

Project: 
Category: None
Status: Open
Summary: table qualifiers lossage

Follow-Ups:

Date: 2001-Nov-01 12:39
By: loic

Comment:
Although it probably seemed a good idea to use the table name to fully qualify 
fields in the SQL requests of the group.c file, it has enormous drawbacks.

- it's not possible to say that a table is "table as name"
  because it would lead to "table as name".field in the request.

- it's not possible to say that a field is "concat(field, 'foo') because it 
would lead to table.concat(field, 'foo').

I understand that this was originaly implemented to prevent name clashes 
between tables. It seems to me that a much better way to achieve this would be 
to:

- recommend in the conf files that ALL FIELDS ARE FULLY QUALIFIED no matter 
what.

- add a minimal check when parsing the conf file (for instance search for a dot 
(.) in the field name and issue a warning if not found, meaning the field is 
not fully qualified. It's probably quite hard to be 100% sure since constructs 
like concat(field, '.') will fool the check. However, unless you're ready to 
include a full SQL expression parser in nss-mysql I don't see a better way to 
proceed.

The attached patch removes *all* table qualifiers from the requests of the 
group.c file, leaving the responsibility of qualifying fields to the author of 
the configuration file. 

Please let me know if you see a problem with this patch, I'd be happy to 
improve it.

For the record, I did not do this patch for the fun, I was truly locked by the 
previous implementation because of the peculiar table arrangement of 
phpGroupWare.
-------------------------------------------------------

-------------------------------------------------------
For more info, visit:

http://savannah.gnu.org/patch/?func=detailpatch&patch_id=47&group_id=443



reply via email to

[Prev in Thread] Current Thread [Next in Thread]