Database code portability problem
thekevinday - March 26, 2009 - 18:42
| Project: | Resource Description Framework (RDF) |
| Version: | 6.x-1.0-alpha7 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
Please correct me if I am misinterpreting this.
In the rdf.db.inc file, you have the following lines:
$result = db_query('SELECT DISTINCT g.uri g FROM {' . db_escape_table($table) . '} d INNER JOIN {rdf_resources} g ON d.gid = g.rid');
and
$sql = 'SELECT g.uri g, s.uri s, p.uri p, o.uri o, t.uri type, d.lang, d.data FROM {%s} d
For the first line, shouldn't g.uri g be g.uri AS g ??
and for the second line, shouldn't g.uri g, s.uri s, p.uri p, o.uri o, t.uri type be g.uri AS g, s.uri AS s, p.uri AS p, o.uri AS o, t.uri AS type
I believe not all sql languages assume the AS keyword.

#1
That's right. For instance PostgreSQL requires AS when specifying alias names for output columns.