]> git.evergreen-ils.org Git - Evergreen.git/commit
This update to oils_cstore.c moves in the direction of supporting
authorscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 21 Jul 2009 17:20:46 +0000 (17:20 +0000)
committerscottmk <scottmk@dcc99617-32d9-48b4-a31d-7c20da2025e4>
Tue, 21 Jul 2009 17:20:46 +0000 (17:20 +0000)
commitb2ef25d2f64ab7c7fed1c519e4dabb8df69e5ab8
tree9eecb19074566c21beea13ea0754992ac8a30ff4
parent3e08ec0c136b821520bd6de9c44a5cbc837ffe78
This update to oils_cstore.c moves in the direction of supporting
table aliases in JSON queries (but we're not there yet).

We now maintain a stack to represent the top level query and any
subqueries nested within it.  In each stack frame we store information
about the core class and any joined classes, including whatever aliases
are used for them.  This stack enables us to look up the table
corresponding to a given alias.

Such searches now replace the old is_joined function for determining
whether a given class is in scope for a column in the SELECT or
ORDER BY clause.

In passing:

1. Rewrote the first few lines of searchJOIN() so that it wouldn't
be so convoluted.

2. We now detect attempts to do autojoins, or to join to the same
table multiple ways.  These are the sorts of queries that need
table aliases to disambiguate the table references,  The old code
would create invalid SQL and then let PostgreSQL complain about it,
Now we complain about it up front.

3. Corrected spelling errors in a couple of messages.

git-svn-id: svn://svn.open-ils.org/ILS/trunk@13674 dcc99617-32d9-48b4-a31d-7c20da2025e4
Open-ILS/src/c-apps/oils_cstore.c