Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Query Caching Bug Fix #98

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Query Caching Bug Fix #98

wants to merge 2 commits into from

Conversation

schirner
Copy link

First of all, thanks a lot for providing such a nice structured interface to MySQL web apps. It helped me a lot!

This PR is a suggestion to fix #97.

first commit

Dependency definitions did not get observed. With original call to loadTable the parameters asked for all tables. The returned object is of type Dataface_DB. Then, condition in line 677 fails. Approach, remove extra parameters, and rely on defaults (no DB defined, single table). With this change, dependencies of a View (as defined in fields.ini) are now observed.

second commit

Tables that have grafted fields using a __sql__ do not get their dependencies attributed. Those tables get a dynamic view named dataface__view__<md5 Sum>. Problem is that the reg ex in line 673 of Dataface/DB.php requires a view in the naming convention of dataface__view__<tableName>_<md5 Sum>. This is needed in order to identify the table name, and subsequently to look up the attributes of the table to determine user listed dependencies.

The second commit changes the view name. The change should be transparent, as just new views are created. Old views are deleted on the next clear views (which operates on dataface__view__%)

One disadvantage of this approach is that column length is limited to 64 characters. Given the current naming conventions, the constant part is already 48 characters long. Leaving only 16 characters for user tables names.

…bles). I presume the parameters to loadTable have changed at some point
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Query Caching dependency tracking is not working for views and tables with __sql__
1 participant